Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

HI team, i am unable to update the assignee field on the basis of another field using post function

Hi Team, 

I am trying to update "Assignee" field based on the another field named as "Incident Assignee" on a  specific transition and has written a script in the post function. The script is not giving any error but the assignee field is not getting updated in the screen even though in the history tab i can see that the assignee has been updated. pfb script written -

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.event.type.EventDispatchOption
import org.apache.log4j.Category
import com.atlassian.jira.issue.MutableIssue
import org.apache.log4j.Logger
import org.apache.log4j.Level

def issueManager = ComponentAccessor.getIssueManager();

def issueService = ComponentAccessor.getIssueService();

def customFieldManager = ComponentAccessor.getCustomFieldManager()

def cf = customFieldManager.getCustomFieldObjectByName("Incident Assignee");

def cfv = issue.getCustomFieldValue(cf); (cfv)

def user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()

def validateAssignResult = issueService.validateAssign(user,, issue.reporterId)

issueService.assign(cfv, validateAssignResult)
issueManager.updateIssue(user, issue, EventDispatchOption.DO_NOT_DISPATCH, false)



Log in or Sign up to comment
Community showcase
Published in Jira

Admins, notify your Jira instance of system-wide changes with the new admin announcement banner

Hi All! We’re excited to share the launch of an announcement banner that lets Jira site administrators communicate directly to their users across their  Jira Cloud instance.  ...

681 views 17 19
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you