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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,551,679
Community Members
 
Community Events
184
Community Groups

Сheck the field value from the task with the field value on the edith screen

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

1 answer

0 votes
Ram Kumar Aravindakshan _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Mar 25, 2022

Hi @Aleksey Ortukov

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:-

behaviour_config.png

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events