Custom field value setting using Script Runner based on issue status

Kaushik Patel February 6, 2020

Hi,

We are using JIRA 8.5.1 and we have installed ScriptRunner Add on version 5.6.7.1.

I want to bulk update statuses of number of sub-tasks basis on 2 conditions using ScriptRunner.

If someone can provide me query basis on below criteria that would be helpful. Or how can this be achieved using ScriptRunner. (I am a bit novice on ScriptRunner)

Requirement example: 

 

Update to new sub-task status of "TYU" for sub-tasks of Current status = abc, xyz and parent task status = MNO, EFG

I have >200 sub-tasks for which this activity is to be done.

1 answer

1 accepted

1 vote
Answer accepted
Ignacio Pulgar
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.
February 6, 2020

Hi @Kaushik Patel ,

If I'm understanding it correctly, the following query would return the subtasks you need to transition:

type = Sub-task AND status in (abc, xyz) AND issueFunction in subtasksOf("type=Task AND status in (MNO, EFG)")

Should you need to include status names with a blankspace, enclose them in single quotes (ie: 'In Progress').

Then, you may transition to the TYU status in one go through a Bulk Change operation (if the transition is available from abc and xyz statuses. Otherwise, it would require two distinct queries, one for each of those statuses).

Hope it helps.

Kaushik Patel February 18, 2020

Thank you @Ignacio Pulgar 

This really helped.

Like Ignacio Pulgar likes this

Suggest an answer

Log in or Sign up to answer