Forums

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

Proper URL format for API call?

Marcus_Dyer June 26, 2020

Above

1 answer

0 votes
Derek Fields _RightStar_
Community Champion
June 28, 2020

What do you mean by "a format I can parse?" 

Do you want to execute the JQL via REST? if so, the call would be 

https://XXX.com/rest/api/latest/search?jql=XXXXX

This will return the list of issues that matches your JQL.

Look at https://docs.atlassian.com/software/jira/docs/api/REST/8.10.0/#api/2/search-search for more information

Marcus_Dyer June 28, 2020

after /latest/ I have "/issue/BIT-1234?jql=XXXXX" 

This is fine right? 

Derek Fields _RightStar_
Community Champion
June 28, 2020

No, you need to use the Search API if you are going to submit JQL. When you use the Issue API, you are generally specifying a specific issue, either by ID or Key.

You are mixing two different things. When you specify BIT-1234, you are indicating that this is the issue that you want to retrieve. When you specify JQL, you are saying "return all of the issues that match this JQL" - they are mutually exclusive things.

If you just want to retrieve the issue BIT-1234, then use 

https://XXX.com/rest/api/latest/issue/BIT-1234

Don't add any JQL after it.

Marcus_Dyer June 28, 2020

let's say my "project = ONE" and "status = IN PROGRESS". How do I get those fields from BIT-1234? Like what would the URL be? Would it just be   

https://XXX.com/rest/api/latest/search?jql=projectXXXXANDXXXXSTATUSXXXXINXXXXPROGRESS

Thanks. 

Derek Fields _RightStar_
Community Champion
June 29, 2020

I don't understand what you are asking. If you call the REST API 

https://XXX.com/rest/api/latest/issue/BIT-1234

it will return a JSON file that includes the project and status as well as most of the rest of the information associated with that issue. I don't understand why you are insisting that you need JQL. JQL is a query language. It doesn't specify what fields are returned, only which issues are returned that match the query. You already know the issue - it is BIT-1234. 

I suggest that make the call that I have suggested and see what you get back.

Suggest an answer

Log in or Sign up to answer