Forums

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

Assignee should be same as Risk owner field

Parsa Mounika June 30, 2022

Hi,

In Jira we have Risk Owner custom field which is user picker. While creating a ticket or updating a ticket the Assignee field should be the same as Risk Owner field. So, can anyone help me on this requirement.

For eg

If my User Picker field name is called Risk Owner and I select myself as the Risk Owner then I should be the Assignee of that same JIRA issue.

2 answers

0 votes
John Funk
Community Champion
June 30, 2022

Hi Parsa,

Create an automation rule based on a Field Value Changed trigger. Then select the Risk Owner field. 

Then add a new action for Edit Issue.

Select the Assignee field.

Click the 3 dots next to the Assignee field and choose Copy From. 

Then change the Field to copy value from to be the Risk Owner field. 

Save and Publish. 

Screenshot.png

Parsa Mounika July 4, 2022

@John Funk , in our jira we are using Automation lite. In that we are able to only edit issue but not edit field. So, can you suggest based on Automation lite plug in.

John Funk
Community Champion
July 4, 2022

I don't think you will be able to do it using only Automation Lite then. 

Parsa Mounika July 4, 2022

@John Funk I tried this request using script when I am moving from one transition to another transition it working fine. But when I am editing the field value with in the transition the value for assignee is not changing. So can you pls help me on this.

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.user.ApplicationUser
import com.atlassian.jira.issue.MutableIssue
// Get required Managers
def customFieldManager = ComponentAccessor.getCustomFieldManager()
MutableIssue issue = issue as MutableIssue
// get a pointer to the Implemented By user picker field and its value
def userCf = customFieldManager.getCustomFieldObjectByName("Risk Identified By")
def implUser = issue.getCustomFieldValue(userCf) as ApplicationUser

// If the Implemented By Field is not null then set the assignee
if(implUser){
issue.setAssigneeId(implUser.username.toString())
}

John Funk
Community Champion
July 4, 2022

Sorry -  that is beyond me. 

0 votes
Dave Mathijs
Community Champion
June 30, 2022

Hi @Parsa Mounika , you should be able to update/sync this via Automation for Jira.

Parsa Mounika June 30, 2022

Hi @Dave Mathijs 

Can you please send me necessary step how to copy the Risk owner custom field value to Assignee field while creating and editing an issue for an Risk issue type.

Suggest an answer

Log in or Sign up to answer