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.
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
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can use the REST resource to search by summary or any JQl filter.
Please see how to use the
https://docs.atlassian.com/software/jira/docs/api/REST/7.6.1/#api/2/search
Best regards,
Pedro Felgueiras
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.