Using Groovy script to set Criticality field value of a JIRA issue to be "Blocker".

Teppei Lyn June 13, 2013

Hello everybody,

Does anyone know how to write a Groovy script and apply it to a JIRA system so that when an email is sent with an exclamation mark (!) in the subject field of the email, a JIRA issue is created with the Criticality field value set as "Blocker".

Thanks in advance.

1 answer

1 vote
Tsol
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.
June 13, 2013

Hi There,

create a postfunction that runs the following groovy script

import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.util.DefaultIssueChangeHolder
import com.atlassian.jira.ComponentManager
import com.atlassian.jira.issue.MutableIssue;
import com.atlassian.jira.issue.ModifiedValue


Issue issue  = issue


if (issue.getSummary().contains("!")){

issue.setPriorityId( '1' );

}

Test it first.

Hope that works

Teppei Lyn June 17, 2013

Thanks, I will try it.

Tsol
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.
June 20, 2013

I think you should add the script as postfunction in Create Transition.

Suggest an answer

Log in or Sign up to answer