You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hi! There was a question.
There are two fields. When changing the value in the first, the value in the second should be deleted.
The following came to mind:
create a script that will check the field value from the task with the field value on the edith form and if they are not equal then the values in the second one will be deleted
In your description, you mentioned:
The following came to mind:
create a script that will check the field value from the task with the field value on the edith form and if they are not equal then the values in the second one will be deleted
In other words, when you open the edit screen, if values in the first list don't match the second list, you want the second list to be reset. Is this correct?
If so, you can use the Behaviour to reset the value of the second list on the Edit screen.
Below is a sample code for your reference:-
import com.onresolve.jira.groovy.user.FieldBehaviours
import groovy.transform.BaseScript
@BaseScript FieldBehaviours behaviours
def sampleList1 = getFieldByName('Sample List')
def sampleList1Value = sampleList1.value.toString()
def sampleList2 = getFieldByName('Sample List 2')
def sampleList2Value = sampleList2.value.toString()
if (underlyingIssue && sampleList1Value != sampleList2Value ) {
sampleList2.setFormValue('-1')
}
Please note, this sample code is not 100% exact to your environment. Hence, you will need to modify it accordingly.
Below is a print screen of the Behaviour configuration:-
If you observe the print screen above, the Behaviour is configured in the Initialiser to trigger the moment the Edit issue screen is loaded.
For more information, you can visit the Adaptavist Documentation.
I hope this helps to solve your question. :)
Thank you and Kind Regards,
Ram
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.