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

Raju KC
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 6, 2013

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

3 answers

1 accepted

2 votes
Answer accepted
Mizan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 6, 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>

Raju KC
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 6, 2013

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
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 6, 2013

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

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

Raju KC
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 6, 2013

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

Mizan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 6, 2013

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

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

0 votes
darylchuah
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 6, 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.

Radu Dumitriu
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 6, 2013

Stock answer ?

0 votes
Radu Dumitriu
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 6, 2013

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

Suggest an answer

Log in or Sign up to answer