Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
Level
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Add a new entity to an existing notification scheme via Scriptrunner

Hello. I am looking for an example Scriptrunner script for adding a new entity to a notification scheme in Jira. I need to add a new entity to a lot of notification schemes and everything I have tried is far from complete.. Hoping someone has an example on hand.

Thanks in advance!

1 answer

0 votes

By "entity" do you mean a (type of) recipient, or a new event?

To explain that a little, each row of a notification scheme, in plain English says:

When <an event of type x> arrives, send an email about it to <a set of people defined by...>

So I'm asking if your "entity" means an event or a set of people?

@Nic Brough _Adaptavist_ I am hoping to add a user picker custom field to an existing scheme/entitytypeId (issue created)

I was attempting to build an entity object and then add it to the Scheme but I may have been going about it the wrong way. I did find the "swap entity parameters" method but that only works if the parameter type is already existing in the entity. 

Using your example, I want:

When an event of typeId 2 arrives, send an email about it to the users within a user picker custom field.

So that does not tell me what "entity" means.  To be blunt and grumpy about it, a notification scheme has "Events" and "People to tell", there's no "entity" mentioned.  The middle paragraph does not work for me.

But the first and last paragraphs really do work for me, they're crystal clear.

On the first paragraph:  "I am hoping to add a user picker custom field to an existing scheme/entitytypeId (issue created)".  You can do that.  In the notification scheme, find "issue created" and then add "custom field -> <your user picker custom field>" to it

On the last one "When an event of typeId 2 arrives, send an email about it to the users within a user picker custom field" - find the event to notify people on and, as the one above, add the user picker custom field as one of the rules to notify people about on that event.

Note - I have a nagging doubt that we've not mentioned events much - have you added some custom events and then added them to workflows (if not, then did you mean to?) and then used them in notifications?

@Nic Brough _Adaptavist_

My overall goal is stated fairly clearly in my last comment:

I am hoping to add a user picker custom field to an existing scheme/entitytypeId (issue created) using a scriptrunner script. This would be via the API, which does contain Schemes, Entities, etc. as I mentioned. 

It seems as though the response received has convoluted this. Please provide an example if you have a script on hand, if not, I am hoping another member of the community has one. 

I'm afraid that makes it even worse.  I cannot work out what you're trying to do at all from that.

I'm going to guess that what you're trying to do is either

  • Add data to an issue
  • Add a field to a project or issue type in the configuration 

Is it one of those two?  If not, then can you tell us what you're trying to do without talking about entities, apis or any of the internals, just explain what changes for the end-user as a result of doing it.

(What I suspect has confused me here is the references to notifications and emails - they have nothing to do with fields directly, and I've been trying to chase down what you mean by "add entity to notification scheme")

Here is a picure @Nic Brough _Adaptavist_ . I want to add a user custom field to a Notification scheme systematically. 

Capture.PNG

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you