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 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
Published yesterday in Jira

Mission-critical battery manufacturer fulfills FAA software requirements with Commit Policy Plugin

EaglePicher Technologies is a leading manufacturer of battery systems for diverse industries like defense, aviation, space or medical. As they operate in highly regulated industries, keeping a clear ...

127 views 0 2
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