Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Copy Field Value Scriptrunner

Howard Nedd
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 19, 2022

Hi,

 

I have a project where I create an issue. The ticket is now in Waiting for support.

My next status is: In Progress 

Prior to getting to that status I have set a transition called Pick Up:
workflow.png

Within this transition I have setup post functions, namely: Create A Linked Issue (JSU) in another project. It creates a linked issue without any problem.


Now I am in the project where the linked issue is created. This linked issue has a Smart Checklist, the Source issue also has a Smart Checklist. 

Within the workflow of the linked issue I have created a transiton which is called: Update Master:
updatemaster.png
As you can see it is a loop from In Progress to In Progress.
Within this transition I have added a post function (scriptrunner):

Copy field values

Copy field values from one field to another



scriptrune.png

 

As far as I can see I have everything setup correctly but the post function is not updating the smart checklist of the issue uin the other project.

What am I missing?

Many Thanks.

Regards
Howard

2 answers

1 vote
Julia Romanenkova_TitanApps_
Contributor
May 26, 2022

Hi @Howard Nedd !

The problem is that  “Copy field values [ScriptRunner]” does not trigger issueUpdated event. And Smart Checklist plugin listens to issueUpdated events and checks if the field Checklists was updated. Nothing was updated in your case because issueUpdated was not triggered.

Instead of adding a “Copy field values [ScriptRunner]” post function we suggest to add a “Custom script post-function [ScriptRunner]” with the following code (sorry, Atlassian doesn't allow to paste it here). 

Howard Nedd
Contributor
May 30, 2022

Hi @Julia Romanenkova_TitanApps_ ,

 

Thank you for taking the time. I added the suggested script via a custom script post function [scriptrunner] to transition within the workflow. Sadly, this is still not giving me the desired result.

scr.png

Am I doing something wrong here?

 

Regards
Howard

0 votes
Craig Nodwell
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 19, 2022

Hey @Howard Nedd there should be an execution log on the scriptrunner post function, have you looked at that for clues?

Howard Nedd
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 19, 2022

Hi Craig,

 

Thank you for replying. 
That's the first place that I have checked but it is just stating that all is OK:

ef.png

Which makes it even more dificult to solve.

Any tips and tricks :)?

Cheers
Howard

Craig Nodwell
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 19, 2022

Not so much errors but what's in the payload .. is it accurate ? Project Issue etc etc for both issues..

payload.JPG

Howard Nedd
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 19, 2022

Good find Craig. 

For some reason the payload is reffering to the same issue twice. Not sure that should be the case. So, TESTISSD-224 should be the trigger issue, but not the target issue. I would expect to see the target issue here which is in another project.

Howard Nedd
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 19, 2022

Also, any idea why this is saying defect?
huuue.png

Craig Nodwell
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 19, 2022

I suspect this setting here...

linkdest.JPG

Craig Nodwell
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 19, 2022

lol you're fast.
that's your inward / outward link description setup by the jira admin.  Getting this right is really important 

Like Howard Nedd likes this
Howard Nedd
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 19, 2022

So I changed it from created by to created as I suspected that that was the issue but this did not solve it.

Howard Nedd
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 19, 2022

As you can see I am making the logic choice by using "Created By" as this is the link type that the issue has:
re.png

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events