Script to replace Summary Field

I would like to know if there is a script so that I can replace the Summary field with two custom fields that the user fills in.

Scenario; user fills in the Issue Create form, and two of the custom fields (CF1 and CF2) now have data in them.

I would then like the script to run as a post function which then updates the Summary field with "CF1 relies on CF2" (for example)

Is this possible?

5 answers

1 accepted

0 votes
Accepted answer


You can do it with javascript or with JJUPIN.

I thought you might be able to, but I have no scripting knowledge, so I was hoping someone would be able to help me write the script.


In the configuration customfield issue type scheme, put this script in the description summary field to hide it (summary field )

<script type="text/javascript">

var summuryField=AJS.$("#summary").parent();



And in the configuration customfield issue type scheme, put this script in the description of one of your custom field

For example ids of your custom fields are like this

CF1 id = customfield_xxxxx
CF2 id = customfield_yyyyy

We put this script in the description of CF2

<script type="text/javascript">

AJS.$('#customfield_xxxxx').keypress(function(){AJS.$('#summary').val(AJS.$("#customfield_xxxxx").val() + AJS.$("customfield_yyyyy ").val());})


This didn't work because the Summary field is set to Required, and I can't seem to un-required it.


Set summary field value with a default value.

Add this script to summary descriptinon

<script type="text/javascript">
var summuryField=AJS.$("#summary").parent();
 AJS.$("#summary").val("default value");

and you can use keyup

Ok, so the issue is now being raised, but the value of summary is coming through as "default value"

the CF ID's are:

CF1: 11327
CF2: 11320

The description of CF2 is:

<script type="text/javascript">
AJS.$('#customfield_11327').keypress(function(){AJS.$('#summary').val(AJS.$("#customfield_11327").val() + AJS.$("customfield_11320").val());})

Sorry for the late reply on this!

I've tried that but the same thing is happening.

CF_11327 - Radio Button called Status with two values (Active and Disabled)
CF_11320 - Text Field (< 255 characters) called Name

Yes, you can do it easily.

We do it using Kepler Rominfo's SIL custom field.

1) Get Kepler customfields from

2) Create new SIL Script Custom Field for example mySILsummary

3) Enter configuration of the field

4) Click "Edit SIL Script"

5) Enter following code:

return customfield_11327 + " relies on " + customfield_11320;

6) In the post-function after issue creation just copy value from the mySILsummary to summary.


We do it all the time with our issues, and it works like a charm :) SIL script field is really helpful every time you need a summary standarized in some way.

How do you get round the fact that the Summary field is on the screen and a required field?

I'd prefer if it wasn't visible to users, and didn't need them to interact with at all.

Yes, it is quite uncomfortable to must have the summary field on the creation screen. However, you can pre-fill it using Behaviours plugin.

In the administrative panel -> plugins -> Behaviours, add new mapping. Map to project and/or issue type you want. Than click "fields", select Summary field, and Add serverside script.

You can use similar one:

import com.atlassian.jira.issue.IssueFieldConstants
import java.util.List
import com.atlassian.crowd.embedded.api.User
import com.atlassian.jira.ComponentManager

User user = ComponentManager.getInstance().getJiraAuthenticationContext().getUser()
FormField formSummary = getFieldById("summary")
FormField formType = getFieldById("issuetype")

if (formType.getValue().contains("paste here number id of issue type"))
{formSummary.setFormValue("Your summary text")

This script will prefill summary only when you choose the required issue Type.

hi Ashley Powell,

you write a postfunction such that get the customfield values CF1 and CF2 from issue object.

Based on your requirement of customfield values set summary using the same issue object.

Finallu update issue and re-index.

You can check for workflow module postfunction.

How do you get round the fact that the Summary field is on the screen and a required field?
I'd prefer if it wasn't visible to users, and didn't need them to interact with at all.
Also, do you have any idea what this postscript would look like?

by default, summary field is required and go through the link

Also, the postfunction will be something like this:

import com.atlassian.jira.component.ComponentAccessor;

import com.atlassian.jira.issue.MutableIssue;

import com.atlassian.jira.issue.IssueManager;


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

Object CF1 = issue.getCustomFieldValue(cfm.getCustomFieldObjectByName("Cus1"));

Object CF2 = issue.getCustomFieldValue(cfm.getCustomFieldObjectByName("Cus2"));

//some logic

if(CF1.toString().equals("x") && CF2.toString().equals("y")){





IssueManager issueManager=ComponentAccessor.getIssueManager();

JiraAuthenticationContext authContext=ComponentAccessor.getJiraAuthenticationContext();



catch(Exception e){



you can try something like this

&lt;script type="text/javascript"&gt;
jQuery(document).ready(function($) {	
JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function (e, context) {	
function  addSummary(){		
		$('input:radio[name=customfield_11327]').click(function() {	
			AJS.$('#summary').val($('input[name=customfield_11327]:checked + label').text() + AJS.$('#customfield_11320').val());
		AJS.$('#summary').val($('input[name=customfield_11327]:checked + label').text() + AJS.$('#customfield_11320').val());


i suggest load javascript as webresource module in a plugin

Works very Good. 

<script type="text/javascript">






Result is: XXXXYYYYY


How do I get the Result: XXXX_YYYYY_Name of the Reporter ?


Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 27, 2018 in Portfolio for Jira

Introducing a new planning experience in Portfolio for Jira (Server/DC)

In the past, Portfolio for Jira required a high degree of detail–foresight that was unrealistic for many businesses to   have–in   order to produce a reliable long-term roadmap. We're tur...

2,562 views 15 21
Read article

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