The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

JIRA Rest API connection in C#

saurabh
August 21, 2017

I am trying to fetch projetcs and issue from JIRA server which is located outside from my network but I am getting Authentication error.

Prior to that, JIRA server is located on client machine an i am trying to connect with my credentials using Atlassian SDK (.Net)

Code is like this :

var jira = Jira.CreateRestClient(" JIRA Server ", "username", "password");
 var selprj = await jira.Projects.GetProjectAsync("projectname");

Error :

Response was not recognized as JSON. Content: Authentication Required

[21/Aug/2017:10:39:49 +0200] / dc2proxy06 / Local IP Address

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Answer accepted
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
August 21, 2017

Your code is not logging into JIRA, so the response when you try to get the project list is effectively "you are not logged in".

You'll need to debug the previous line that tries to create a connection object, as it's not working.

0 votes
saurabh
August 21, 2017

Thank you Nic for you response.

Could you help me to establish connection?

When I tried with same line with my local server it works fine, It will help me  if you post some example about connections...

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
August 22, 2017

Sorry, I was totally unclear in my first line.  It looks to me like your JIRA server is behind a proxy that is demanding authentication before you get to JIRA.

You'll need to code for that as well as the JIRA connection.

saurabh
August 22, 2017

could you have simple example to call JIRA REST API through C#.NET

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
August 22, 2017

I've not used C# for years and don't have one to hand.  There's mention of the starting point though at https://community.atlassian.com/t5/Bitbucket-discussions/How-can-I-use-JIRA-Rest-API-in-C-net/m-p/628365#M122

TAGS
AUG Leaders

Atlassian Community Events