Hi folks,
I have a tough issue here and need some assistance coming up with a solution.
Background
Jira Software 8.2.0
Adaptavist ScriptRunner 5.5.8.1-jira8
I have an inherited Jira Software instance that I have been slowly working on cleaning up, as it outgrew its original purpose long ago.
One of my projects has a Single Select List custom field named TTS Approver. It contains a text list users that can approve issues in the TTS project. I'm trying to get rid of this Single Select List in favor of a new Single User Picker custom field, which will be much easier to manage. Let's call it newApprover for now.
Creating the newApprover field is easy enough, and I've added it to the relevant screens in my test environment. The problem I face now is replacing the old TTS Approver information in existing issues (both resolved and unresolved) with this new field. I will then remove the old field from the screens and rename newApprover as TTS Approver. I'm looking at about 35,000 issues in this project alone.
Problem
I thought I could use ScriptRunner's built-in script Copy custom field values to simply copy the value from TTS Approver to newApprover, but this does not work with User Picker custom fields.
Does anyone know a way to script this such that the text value in TTS Approver = the name property of the newApprover user field, and thus the correct user will be populated in the field?
Hi @James Breunig ,
The script is attached to the Downtime Start field, which means, that it is executed, after the Downtime Start field is filled in. When you create the issue, you probably first fill in the Downtime Start field, then the validator is executed, but the Downtime End field is empty, so nothing happens, and then you fill in the Downtine End field, but there is no validator set.
Could it be the possible explanation?
So maybe you could add the second validator to the Downtime End field, because you want to do the check every time one of the fields is changed?
I also believe it is not neccessary to have all the imports in the script. It should work without them.
I've copied the script above into a server-side script for Downtime End. I've tried changing the order I fill them in. Still appears not to work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That's strange, it works for me :-(
Just quick check - did you setup mapping for the behaviour?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Wow! That was it! I didn't know you have to pick a specific issuetype or it would not work. Thank you!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.