Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

copy field value from one field to another within same issue

Hi All,

We have a requirement to copy field value from Summary to Ticket Summary (Text field) and Description to Ticket Description (Text Field ) .

Can some one help with the listner script to achive.

your inputs are highly appreciated.


Thank you,


1 answer

1 accepted

0 votes
Answer accepted

Hi @Varun Joseph Allu

For your requirement, you can try something like this:-

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

def issue = event.issue as MutableIssue

def customFieldManager = ComponentAccessor.customFieldManager
def issueManager = ComponentAccessor.issueManager
def loggedInUser = ComponentAccessor.jiraAuthenticationContext.loggedInUser

def sampleTextField = customFieldManager.getCustomFieldObjectsByName('Sample Text Field').first()
def sampleMultiLineText = customFieldManager.getCustomFieldObjectsByName('Sample Multi Line Text').first()

def description = issue.description
def summary = issue.summary

if (summary && description) {
issue.setCustomFieldValue(sampleTextField, summary)
issue.setCustomFieldValue(sampleMultiLineText, description)
issueManager.updateIssue(loggedInUser, issue, EventDispatchOption.DO_NOT_DISPATCH, false)

Please note that the sample code provided is not 100% exact to your environment. Hence,  you will need to make the required modifications.

Below is a screenshot of the Listener Configuration:-


Below are a few test screenshots for your reference:-

1. First, when creating a new issue, only the values for the Summary and Description fields are entered.


2. Once the issue has been created, as expected, the values from the Summary and Description fields are copied to the Sample Text Field and Sample Multi Line Text field accordingly, as shown in the screenshot below:-


3. If the Summary field is updated, the Sample Text Field is updated accordingly, as shown in the screenshots below:-


4. Similarly, if the Description field is updated, the Sample Multi Line Text field is updated accordingly, as shown below:-



I hope this helps to solve your question. :)


Thank you and Kind regards,


Hi @Ram Kumar Aravindakshan _Adaptavist_  ,


Thanks for the script,
It is working as expected.
Thank a lot for your support.



Suggest an answer

Log in or Sign up to answer

Atlassian Community Events