Forums

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

Extracting data using the rest api

Keith Thomas May 30, 2024

Complete Jira newbie here. I am writing my client in C#. I want to query User Stories by project and get a list of them which I will put in a CSV. I'm nervous about experimenting because I don't want to risk messing up any data. As far I can tell my api token is not a read-only token. There must be a recent/current end-to-end example of how to get a list of User Stories, via C#, which includes number, title/name and history/state-changes. Google has let me down so I'm here for the first time :)

2 answers

2 accepted

4 votes
Answer accepted
Oliver Siebenmarck _Polymetis Apps_
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 Leaders.
May 30, 2024

Hi @Keith Thomas ,

Welcome to the community! 

Jira offers a REST API which is what your client is most likely going to use. The way Jira's REST API is implemented follows the standards when it comes to http verbs, ie. as long as you only send a GET request, you will not mess up any data.

Your API token is basically you, it has the same permissions and can do the same things you can do when using the browser. Some people create functional users with limited permissions and use their API tokens to limit their scripts. Or you can get an app like ours (API Key Manager for Jira), to create custom, limited use API keys. But to be honest, I think you'll be fine with your API token and sticking with GET requests for the time being.

As for getting issues via API, I believe you'll want to use the JQL API, which allows you to retrieve all issues matching a JQL query, like this one for example:

issuetype = Story and project = "Your project"

Finally, there is also a developer community which you should definitely check out.

Hope that helps,
 Oliver

 

2 votes
Answer accepted
Rudy Holtkamp
Community Champion
May 30, 2024
Keith Thomas May 30, 2024

Thank you, almost there. I've installed the Nuget Package but can't use the code snippets as I don't have a full example, i.e. nothing that includes a "using" statement.

Keith Thomas May 30, 2024

Also, the example uses username and password instead of the api key.

Keith Thomas May 31, 2024

OK, through looking at the code I found t:

 

using Atlassian.Jira;
Like Scott Crenshaw likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events