I have a listener script in ScriptRunner which runs when an issue is created within Service Desk and sends a linked issue to a relevant software project (based on request type selected).
As some requests are Service requests with approvals. I would like to hold off running the script until the status changes (from ‘waiting for approval’) to ‘waiting for support’.
If anyone could help by advising what I needed to add to my current script to achieve this, that would be greatly appreciated!!!
Here is the current script:
import com.atlassian.jira.component.ComponentAccessor
def cf = ComponentAccessor.customFieldManager.getCustomFieldObjectByName("Customer Request Type")
def requestType = issue.getCustomFieldValue(cf)
if(requestType.toString() == "de/f0449f4c-a359-4d60-b516-70034ff84321")
{return true}
Thanks
Hello, Col!
I believe you can change your if statement to check the issue status:
if(requestType.toString() == "de/f0449f4c-a359-4d60-b516-70034ff84321" && issue.status == "Waiting for support")
Make sure that you check the status only in the IF along with the "Service Request" type, in this case, you'll need another IF for the rest of the issue types.
Kind regards,
Maurício Karas
Thanks Mauricio. It accepts the code, but I am having trouble getting the automation to fire. Any suggestions?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.