set summary field value

How can i set the summary field, to a specific value? Basically i have set them all to a default and now i want to change it to match two custom fields joined together..

Here is the code i am using but with no luck:(

<!-- @@Formula: if (issue.get("customfield_10001") == null
	return "Product Master";
	else
	return ("Masters" + issue.get("customfield_10001") + " " + issue.get("customfield_10281"))
	-->

i have also tried this:

<script type="text/javascript">
  
var summaryField=AJS.$("#summary").parent();
 AJS.$("#summary").val("Masters" + issue.get("customfield_10001") + " " + issue.get("customfield_10281"));
summaryField.hide();
  
</script>

2 answers

This widget could not be displayed.

Anyone able to assist?

This widget could not be displayed.
Vasiliy Zverev Community Champion Feb 23, 2016

I do not know well javascript, but if you need to update issue you need to call IssueManager.updateIssue() method (https://docs.atlassian.com/jira/latest/com/atlassian/jira/issue/IssueManager.html).

Here is version for JAVA API:

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.event.type.EventDispatchOption

issue.setSummary( issue.getSummary() + "They killed Han Solo, bustards!" );
issueManager.updateIssue(ComponentAccessor.jiraAuthenticationContext.getUser().directoryUser, issue, EventDispatchOption.ISSUE_UPDATED, false);

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

215 views 3 0
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