Forums

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

Run a ‘clones an issue, and links’ script when status changes in service desk

Col Robins August 15, 2018

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

1 answer

0 votes
Mauricio Karas
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 20, 2018

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

Col Robins October 24, 2018

Thanks Mauricio. It accepts the code, but I am having trouble getting the automation to fire. Any suggestions?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events