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

Does the issue update with HAPI throw an issue update event (and notification)?

Hello,

I have an scripts that goes through 100 of issues to update a field. I do not want to spam everyone with emails but I cannot find in the documentation if when I use HAPI I can disable emails.

If I have a script similar to this

Issues.search('project = ZOO').each { issue ->
dadadadad
}
issue.update {
        setCustomFieldValue('CF', value)
}
Does this throw an issue updated event, and therefore a notification? I see it in the issue history so I guess yes? Is there a way for me to disable the notification?
(I know that I can remove the notification scheme but you used to be able to disable it in the code)
Thanks!

1 comment

Comment

Log in or Sign up to comment
Reece Lander [ScriptRunner - The Adaptavist Group]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Oct 26, 2023 • edited

Hey!

By default the issue update will fire an event and send an email, this however can be opted out, which is a good idea when doing bulk updates.

I see that this option is omitted from our documentation, I'll get that fixed up right away.

 

import com.atlassian.jira.event.type.EventDispatchOption

issue.update {
setSummary('New summary')
setEventDispatchOption(EventDispatchOption.DO_NOT_DISPATCH)
setSendEmail(false)
}
Like # people like this

Thank you so much! You cant imagine how much I needed this!

Peter-Dave Sheehan
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Oct 27, 2023

Thanks @Reece Lander [ScriptRunner - The Adaptavist Group] 

I tried looking for anything related to this in the documentation including the JavaDocs. Doesn't seem to be there yet.

Can you help provide some clues as to where in the JavaDocs the various methods available in those update methods (listed as Closure<?>specification ) can be found?

Also, I was not able to identify if there is a similar method for Assets.

E.g.

import com.riadalabs.jira.plugins.insight.services.events.EventDispatchOption

def object = Assets.getByKey('KEY-123')
object.update {
setEventDispatchOption(EventDispatchOption.DO_NOT_DISPATCH)
setAttribute('AttributeName', 'new value')
}

All or most ObjectFacade methods have an signature that includes an EventDispatchOption.

It would be nice to be able leverage that via HAPI.

TAGS
AUG Leaders

Atlassian Community Events