Hey everyone, I’m having a hard time with the Atlassian.SDK in my Azure function project. I can’t seem to connect to Jira Cloud. I’ve tried using both the FQDN and the full API endpoint as the URL, but no luck.
Here’s the code I’m using:
var jira = Jira.CreateRestClient(jiraUrl, "user@domain", "apikey");
It throws this error:
System.MissingMethodException: Method not found: 'Void RestSharp.RestClient..ctor(System.String)'.
Weirdly, using RestSharp directly works fine:
var auth = new HttpBasicAuthenticator("user@domain", "apikey");
var jiraOptions = new RestClientOptions(jiraUrl) {Authenticator = auth};
var jira = new RestClient(jiraOptions);
I’m using .NET Core 3.1, Atlassian.SDK 13.0.0, RestSharp 110.2.0, and Newtonsoft.Json 13.0.3.
Any ideas what might be causing this? Thanks in advance for any help!
dude, i had the same prob. downgrade restsharp to 106.11.7 like Emma said. it fixed it 4 me. if not, just use the direct restsharp approach. its more flexible anyway. gl with ur project!
I’ve faced this exact issue in my Azure Functions project. The root cause is indeed a version mismatch between Atlassian.SDK and RestSharp. Here’s what worked for me:
Instead of downgrading RestSharp, I updated Atlassian.SDK to version 13.0.1. This version is compatible with newer RestSharp releases.
If that doesn’t solve it, consider using the official Atlassian.NET SDK (Atlas.NET) instead. It’s more actively maintained and designed for modern .NET environments.
As a last resort, you could implement your own lightweight Jira client using HttpClient. This gives you full control and avoids dependency issues. It’s a bit more work upfront but can save headaches in the long run.
Remember to clear your NuGet cache and rebuild after making changes. Good luck with your project!
I’ve encountered similar issues with Atlassian.SDK in Azure Functions before. The problem likely stems from version incompatibilities between the SDK and RestSharp. Atlassian.SDK 13.0.0 might be expecting an older version of RestSharp, causing the method not found error.
To resolve this, try downgrading RestSharp to version 106.11.7, which is known to work well with Atlassian.SDK 13.0.0. You can do this by modifying your project’s package references.
If downgrading doesn’t solve the issue, consider using the direct RestSharp approach you mentioned. It’s more flexible and offers better control over HTTP requests. You can then use Newtonsoft.Json to deserialize responses into Jira objects as needed.
Alternatively, explore newer versions of Atlassian.SDK or consider switching to the official Atlassian.Net SDK for better compatibility with recent .NET Core versions and Azure Functions.