C# Atlassian SDK: Trouble establishing JIRA connection

Hey everyone, I’m hitting a roadblock with the Atlassian SDK for C#. I’m trying to set up a basic connection to my JIRA instance to fetch some task info, but I’m running into some weird errors.

I tried using this code:

JiraManager connector = new JiraManager(serverAddress, "userAccount", "secretPass");

But I’m getting these strange errors:

  • Can’t convert ‘string’ to ‘Atlassian.Jira.ServiceLocator’
  • Can’t convert ‘string’ to ‘Atlassian.Jira.JiraCredentials’
  • Can’t convert ‘string’ to ‘Atlassian.Jira.JiraCache’

I’ve looked around for docs on these errors, but I’m coming up empty. Our work firewall is blocking the SDK’s repo, so I can’t check there either.

Has anyone run into this before? Any tips on how to get past these conversion errors and connect to JIRA? I’m pretty stumped here. Thanks for any help!

I’ve been there, mate. Those errors are a pain. From my experience, the issue might be with how you’re initializing the Jira client. Instead of JiraManager, try using the Jira.CreateRestClient method. It’s more straightforward and less prone to these weird conversion errors.

Here’s what worked for me:

var jira = Jira.CreateRestClient(serverAddress, "userAccount", "secretPass");

Also, make sure you’re using the latest version of the Atlassian.SDK NuGet package. Older versions can cause unexpected issues.

If you’re still getting errors, it might be worth checking your JIRA instance’s API settings. Sometimes, API access needs to be explicitly enabled or your account might need specific permissions.

Lastly, if your work firewall is giving you trouble, consider talking to your IT department about allowing access to the SDK repo. It can be a lifesaver when troubleshooting these kinds of issues.

hey mate, i had similar probs. try this:

var jira = Jira.CreateRestClient("http://yourjiraurl", "username", "password");

make sure u got the latest Atlassian.SDK package. if it still fails, check ur firewall settings. might be blocking the connection. good luck!

I encountered similar issues when working with the Atlassian SDK for C# recently. The problem likely stems from using an outdated version of the SDK or referencing the wrong namespace. Try updating your NuGet package to the latest version of Atlassian.SDK.

If that doesn’t work, double-check your using statements. Make sure you have ‘using Atlassian.Jira;’ at the top of your file. Also, the JiraManager class might be deprecated. Instead, try using the Jira class constructor like this:

var jira = Jira.CreateRestClient(serverAddress, username, password);

This approach worked for me and should resolve those conversion errors. If you’re still stuck, consider using a personal access token instead of username/password for authentication. It’s more secure and often bypasses connection issues.