Below script not working for updating summary in create issue transition ::: Any Help

import com.atlassian.jira.issue.Issue

import com.atlassian.jira.issue.CustomFieldManager

import com.atlassian.jira.issue.fields.CustomField

import com.atlassian.jira.ComponentManager

Issue issue = issue;

ComponentManager componentManager = ComponentManager.getInstance();

CustomFieldManager customFieldManager = componentManager.getCustomFieldManager();

CustomField customField1 = customFieldManager.getCustomFieldObject('customfield_10589') ;

CustomField customField2 = customFieldManager.getCustomFieldObject('customfield_10590');

firstname = issue.getCustomFieldValue(customField1)?.getValue();

lastname = issue.getCustomFieldValue(customField2)?.getValue();

if (firstname && issue.summary){

if (issue.summary.contains(firstname) && issue.summary.contains(lastname)){

issue.summary = "Joiner:"+ issue.summary;



issue.summary ="Joiner: "+firstname+" "+lastname;




return false;


2 answers

1 accepted

you need to update the issue after setting the fields.

where you are writing this script in workflow postfunction?

Yes, i am running it in the post function

import com.atlassian.jira.component.ComponentAccessor;

import com.atlassian.jira.issue.IssueManager;

import com.atlassian.jira.event.type.EventDispatchOption;


ComponentAccessor comAcc=new ComponentAccessor();

CustomFieldManager cfm = comAcc.getCustomFieldManager();

CustomField customField1 = cfm.getCustomFieldObjectByName("FirstName");

CustomField customField2 = cfm.getCustomFieldObjectByName("LastName");

MutableIssue issue=(MutableIssue)transientVariables.get("issue");

String fname=issue.getCustomFieldValue(customField1).toString();

String lname=issue.getCustomFieldValue(customField2).toString();


if (issue.getSummary.contains(fname) && issue.getSummary.contains(lname)){

issue.setSummary("Joiner:"+ issue.getSummary);



issue.setSummary("Joiner: "+fname+" "+lname);



JiraAuthenticationContext authContext = comAcc.getJiraAuthenticationContext();

comAcc.getIssueManager().updateIssue(authContext.getLoggedInUser() , issue, EventDispatchOption.EventDispatchOptionImpl.ISSUE_UPDATED , true);



catch(Exception e){




The above kind of Java code worked for me.

The issue should be Mutable Issue and also the customfield are of text type.

Hi Bharadwaj,

It did not worked exactly because of lots of dependencies.. but it really helped in understanding a lot of new thing and Now I have developed a script of my own which is working as per the requirements.

Thanks a ton for all the Help.


-- SR

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Wednesday in Jira

Join our webinar: How 1B+ feature flag events helped us build the new Jira

Every time you release software, there's a bit of risk – that there's a bug, that something breaks, or that the feature doesn't resonate with customers. Feature flagging helps make high stakes s...

93 views 0 1
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you