Can't connect to my jira (cloud) using Atlassian.SDK

I recognize that this is not an official SDK but since Atlassian doesn’t have one for C# thought I’d post this here.

I am trying to use the Atlassian.SDK in an Azure function project and it won’t even connect. This is jira cloud so I’m using https://mycompany.atlassian.net as the URL. The one thing that wasn’t clear in the docs was if you need the entire API endpoint or just the FQDN as above. That said, I tried it both ways.

var jira = Jira.CreateRestClient(jiraUrl, "user@domain","apikey");

When that executes it throws the following exception:

System.MissingMethodException: Method not found: 'Void RestSharp.RestClient..ctor(System.String)'.
   at Atlassian.Jira.Remote.JiraRestClient..ctor(String url, IAuthenticator authenticator, JiraRestClientSettings settings)
   at Atlassian.Jira.Remote.JiraRestClient..ctor(String url, String username, String password, JiraRestClientSettings settings)
   at Atlassian.Jira.Jira.CreateRestClient(String url, String username, String password, JiraRestClientSettings settings)

Using the exact same credentials with a RestSharp RestClient works fine.

var auth = new HttpBasicAuthenticator("user@domain", "apikey");
var jiraOptions = new RestClientOptions(jiraUrl) {Authenticator = auth };
var jira = new RestClient(jiraOptions);

Versions

Item Version
.NET Core 3.1
Atlassian.SDK 13.0.0
RestSharp 110.2.0
Newtonsoft.Json 13.0.3 (added this explicitly to see if it would help … it did not).

@RandyKnight,

I think this is your problem:

var jira = Jira.CreateRestClient(jiraUrl, "user@domain","apikey");

While the exception shows a method with 4 parameters:

Atlassian.Jira.Jira.CreateRestClient(String url, String username, String password, JiraRestClientSettings settings)

It looks like you need to construct a JiraRestClientSettings object too.

All that said, that is some old code and trying to run it against Jira Cloud is not going to be easy. Best of luck.

A fair point. I am certainly open to alternatives but there is not much out there. I have tried autorest and swagger-codegen with limited success as well. There are things from the definition they don’t seem to like.