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,462,535
Community Members
 
Community Events
176
Community Groups

Groovy Script Help For Condition for Group Picker Filed in script Listener

Kumar Rising Star Dec 19, 2018

Hi Team,

I Have a Group Picker Field (Single picker) here i'm trying that when I created a ticket When that particular group value chages to Group "-Y-" in any status only that particular group has to get notification.

Here I'm performing when an issue is updating in the particular group filed  changes to "-Y-" group only that group required the notification. If that field chages to "-X-" or "-Z-" they dont required notification

 

Here is the steps i have followed 

> I created a custom event named "Notification" and selected the template "issue update" 

> in notification scheme i have selected that group in that partucular custom event.

> in the " Script Listener " a added a custom Listener and added a script 

import com.atlassian.jira.component.ComponentAccessor

def customFieldManager = ComponentAccessor.customFieldManager

def issue = event.issue
def customField = customFieldManager.getCustomFieldObject(10002 as Long)
log.warn("Custom field: " + customField)
def customFieldValue = issue.getCustomFieldValue(customField)
log.warn("Custom field value: " + customFieldValue)

log.warn("Result: " + customFieldValue == "-Y-")
return customFieldValue == "-Y-"

> in events I selected the Issueupdate and Custom Event I created and target project i seletcted the project that i want

>I updated the ticket I got these errors 

2018-12-19 17:17:06,644 WARN [runner.ScriptRunnerImpl]: Custom field:  Group
2018-12-19 17:17:06,644 WARN [runner.ScriptRunnerImpl]: Custom field value: [com.atlassian.crowd.embedded.impl.ImmutableGroup@bd6c997c]
2018-12-19 17:17:06,644 WARN [runner.ScriptRunnerImpl]: false

 

Can anybody help me with the script

 

Thanks,

Kumar

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events