Forums

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

Generating priority based on keywords in descripton

Ivan Kordic
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 15, 2020

Hello,

I'm working on issue generation by using Jira API and curl on Jira Cloud.

I have no problems generating new issues this way and everything goes smooth:

curl \
--request POST \
--url 'https://<URL>.atlassian.net/rest/api/3/issue' \
--user 'user@somemail.com:APITOKEN' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data @jiraData

jiraData:

{
"fields":{
"project":{
"key":"TES"
},
"summary":"TEST",
"description":{
"type":"doc",
"version":1,
"content":[
{
"type":"paragraph",
"content":[
{
"type":"text",
"text":"description"
}
]
}
]
},
"issuetype":{
"name":"Task"
}
}
}

 

My question - is there a way to automatically assign the priority of the generated issue based on a keyword in the description?

Example - If the description contains words "old" or "outdated" automatically set the priority of the issue to High, but if it doesn't set the priority of the issue to Minor.

Can this be accomplished using only Jira, or do I need to make a script to scan the jiraData file and if it detects any of the keywords make the script modify the jiraData by adding the priority field and then running curl?

2 answers

1 accepted

1 vote
Answer accepted
Krister Broman _Advania_
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.
January 16, 2020

Only Jira, meaning not using plugins? 

Easiest way by a mile is to use one of the plugins that build more automation functionality like Automation for Jira. 

If you don't want to use plugins and are generating these issues then I would suggest that you build that functionality into the creation process. 

Ivan Kordic
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 16, 2020

Thank you for the information. I was not aware there are plugins for this.

Problem solved.

0 votes
Rafał Nowakowski
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 16, 2020

Try set this dependencies not around api but in workflow post function on create. I think this is the best place to set this.


I am not sure basic post functions will allow it to You, but if You have ScriptRunner that shouldnt be any problem.

Krister Broman _Advania_
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.
January 16, 2020

Workflow post functions could set the priority but you would not have the "IF / THEN" statement that is needed to control the behavior. 

I guess a possibility would be to have multiple transitions and then use conditions to limit which transition is chosen, leaving only one option, then add a way to autotransiton the issue.....

I would not recommend anyone doing it this way though as I can see way to many issues with user interaction and admin for this.   

Like Ivan Kordic likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events