Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Copy field-value to other field within the same issue

Antonio D'Errico
Contributor
November 7, 2017

Hello,

i want to create an escalation service which will copy and append all values from the field label to the field labels.

best regards

toni

 

3 answers

0 votes
Sai Praveen Aminigadda February 27, 2020

@Antonio D_Errico  did you accomplish this requirement?

0 votes
Nic Brough -Adaptavist-
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.
November 10, 2017

Can you explain when you want this script to run and what it should do in full?  You say escalation, but don't define what the trigger for it is.

The code snippet Anton gave is the core of getting a label that is currently on a specific issue, so you can use it later to update other fields. 

But I don't know if you're trying to copy the data from field to field on a single issue, or for a range of issues, or from one issue to another, or something else.

Antonio D'Errico
Contributor
November 10, 2017

ok here is my case:

we have a custom-field called label and the systemfield labels. we want to remove that custom-field label. so this is our situation and our goal.

i want to copy and append all values from label to labels.

i can not do it with a bulk-change. i could do it over a post-function with copy field-value to other field. since we have 40 workflows and many transition it does not make sense to define this post function in every transition.

so i want to create an escalation service which run only one time. it will search for all issues where the field label is not empty and will copy and append these values to the field labels. on the next morning i will check it and disable the escalation service and delete the field label.

0 votes
Anton Chemlev - Toolstrek -
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.
November 8, 2017

You can find a lot here - https://community.atlassian.com/t5/Jira-Core-questions/Copy-Custom-field-value-from-one-field-to-another/qaq-p/73207

For example, to get labels from system field "Labels", you can use smth like this:

import com.atlassian.jira.component.ComponentAccessor
def issue = ComponentAccessor.getIssueManager().getIssueObject("issuekey");
issue.getLabels()
Antonio D'Errico
Contributor
November 10, 2017

I need a script which is not only for one issue rather dann for a whole project.

Anton Chemlev - Toolstrek -
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.
November 10, 2017

If you want to use escalation service, issue scope will be defined via JQL you provide. For setting issue in escalation service see this https://scriptrunner.adaptavist.com/5.0.2/jira/escalation-service.html

Don't you mess up escalation service and script listener? First acts on schedule, latter every time when an event/-s fires and some conditions passes. What exactly do you need?

Carole I_
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 15, 2022

@Anton Chemlev - Toolstrek - 

Hey, following this long-time-ago tread ; 

I would need to copy field value to another field from all issues of 1 project (one time) 

We are currently using 'Due Date' and want to move to 'Deadline'

Suggest an answer

Log in or Sign up to answer