How to copy one field to anther while performing edit operation?

How to copy one field to anther while performing edit operation?

3 answers

1 accepted

2 votes
Mizan Community Champion May 06, 2013

You will need to add javascript in the field description which will check if it is the edit screen then copy the value from one field to another .

My way of checking the editing screen is as below (JIRA 5.1.x)

<script type="text/javascript">
AJS.$(document).ready(function() {
	AJS.$(document).bind('dialogContentReady',   function(event, dialog) {
		if(AJS.$(".aui-popup-heading").text().trim()=='Configure FieldsEdit Issue'){
			// Your Script
		}
	});
});
</script>

Hey Mizan,

I want to display "A" field in edit screen as "B". But not works. Can you test in yours

<script type="text/javascript">
AJS.$(document).ready(function() {
AJS.$(document).bind('dialogContentReady', function(event, dialog) {
if(AJS.$(".aui-popup-heading").text().trim()=='Configure FieldsEdit Issue'){

AJS.$("#customfield_11125").text("B");
}
});
});
</script>

Mizan Community Champion May 06, 2013

You need val() .. AJS.$("#customfield_11125").val("B");

This works for me . I hope your customfield is a text field / text area field

I mean I want to change label, not field value.

Mizan Community Champion May 06, 2013

This was a tough one ... hope you will vote up my posts :D

AJS.$('label[for="customfield_11125"]').text("B")

JJupin Live Fields can certainly help you with that. Give it a try: https://marketplace.atlassian.com/plugins/com.keplerrominfo.jira.plugins.jjupin

0 vote
Daryl Chuah Atlassian Team May 06, 2013

It is not possible to copy one field to another while you are editing an issue. However, you can clone an issue in JIRA.

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,203 views 13 19
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot