Forums

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

Script with scriptRunner to automate task jira

Cédric_A
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!
July 10, 2020

Hi Community,

Please help me to implemnt this two scripts groovy


1) - On issue type 'Analyze', I would like to add a new date field 'Qualification date' which automatically indicates the first time that a request of type 'Analyze' is moved. The objective is to know when a request has been moved for the first time

2) - On the 'Anomaly' issue types, I would like to add a 'Date P1' date field which automatically indicates the first time that an issue type 'anomaly' has 'Priority = P1'.
NB: This date can be the date of creation of the issue.

 

 Best regards.

1 answer

0 votes
Martin Bayer _MoroSystems_ s_r_o__
Community Champion
July 11, 2020

@Cédric_A 

1) what do you mean by "moved". Do you mean "Move issue" action?

2) I think you will have to use two scripts, one for "initial transition" to cover requirement that it can be set when creating issue.

2.1) Create issue action - I would add scripted postfunction with script similar to script which is marked as Accepted answer here https://community.atlassian.com/t5/Jira-Questions/Scripted-post-function-to-set-a-date-value-in-custom-field/qaq-p/368278

2.2) You have to cover "Edit issue" operation. I would use script runner listeners functionality (https://scriptrunner.adaptavist.com/6.4.0/jira/listeners.html), you have to write similar script but you have to add condition for project(if Anomaly issue type is used in only one project) and issuetype to not to run the whole script for every "Edit issue" operation.

Do you need to help with scripts or this "suggestion" is enough?

Suggest an answer

Log in or Sign up to answer