Change assignee to custom field value based on components

J July 31, 2019

Is there a way to update the assignee from a custom field value based on components during a workflow transition?  For example: 

Component = xyz

Owner (Custom Field) = Jane Smith 

Assignee = John Doe 

I'd like to update the Assignee field to Jane Smith (which the value of the Owner) when the issue transition from IN PROGRESS to Development. 

There is a post function called Assign from custom field but that's a straight assignment, no need to specify condition. 

2 answers

0 votes
Krishnanand Nayak
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.
September 17, 2019

here is the scriptrunner code:

if ('xyz' in issue.components*.name and issue.reporterId = 'userId'){

     issue.assigneeId = 'newUserId';

}
0 votes
Alexey Matveev
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.
August 1, 2019

Hello,

You can not accomplish it without an app. You would need an app like Power Scripts, Scriptrunner, Automation for Jira.

If you want to use the Power Scripts app then you can write a post function like this;

if ("xyz" in components and reporter = "jane.smith") {

   assignee = "john.doe";

}
J August 6, 2019

We use scriptrunner, how do I accomplish this in scriptrunner post function? 

Suggest an answer

Log in or Sign up to answer