Forums

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

Is there a way to get a ticket/issue key or number using just the ticket summary in Linux?

Azeus System Team February 19, 2018

I am creating a script in Linux and I need to acquire a ticket's issue key given the ticket summary. Do I need the Jira CLI for this? I tried using curl to get the issue's REST API (rest/api/latest/issue/) but it requires user credentials and I don't know how to do that in Linux CLI.

1 answer

1 accepted

0 votes
Answer accepted
Pedro Felgueiras
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.
February 19, 2018

Hy @Azeus System Team

 

You have to make rest call and use the curl command. 

For the simplicity of use, you can make the call using postman and after that you can view the result 

 On postman you can get the sample code clicking on the button "code" located on the right side. Here is an example:

curl -X POST \
https://jira.url.com/jira/rest/api/latest/issue/ \
-H 'Authorization: Basic aaaaaaaaaaaaaa' \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/json' \
-d '{"json":"data"}'

 

Best regards, 

Pedro Felgueiras

Azeus System Team February 19, 2018

Thanks for responding. Sorry I'm new to this and I'm still reading up on curl POST and GET commands. But does the code you posted above work like this:

"For example, I have a ticket whose issue key is TICKET-1234 and whose summary is 'Workstation Problem A'. My input to the script would be 'Workstation Problem A' and the output should be TICKET-1234."

I think the curl command would only be able to help me if I know the issue key and I need the summary, not the other way around. What do you think?

Pedro Felgueiras
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.
February 20, 2018

You can use the REST resource to search by summary or any JQl filter. 

 

Please see how to use the 

api/2/search

 

https://docs.atlassian.com/software/jira/docs/api/REST/7.6.1/#api/2/search

 

Best regards, 

Pedro Felgueiras 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events