You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.
View groupJoin the community to find out what other Atlassian users are discussing, debating and creating.
Hi Community,
In scriptrunner, I am having problem to sort the value these 2 variables: "participants" and "cfValpart"
For the following line:
if (participants != cfValpart){
.....
}
The comparison is made but the value needs to be in order. Take for examples the following 2 mentioned scenario:
Scenario 1:
participants =
{John, Pierre, Alana}
cfValpart = {John, Pierre, Alana}
The comparison return true.
But Scenario 2:
participants =
{John, Pierre, Alana}
cfValpart =
{Pierre, John, Alana}
The comparison return false. (Where it should be true)
I have use to the following ".order" but the cfValpart is not accepting the function.
Can I have some advise or help on the issue
Best regards,
Jason Li
As long as both variables are Lists of the same type (eg. String), then you can use something like:
if (participants.sort() != cfValpart.sort()) {
...
}
If not, use the groovy .collect { .. } construct to extract the values you want to compare into a List of Strings.
We often have questions from folks using Jira Service Management about the benefits to using Premium. Check out this video to learn how you can unlock even more value in our Premium plan. &nb...
Connect with like-minded Atlassian users at free events near you!
Find an eventConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.
Host an eventYou're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.