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

In Jira Cloud Automation, is there a way to CC an email to the rule owner?

Cash Coyne
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.
February 6, 2024

In Jira Automation, is there a way to CC an email to the rule owner?

In a rule, I want an email to be sent to the initiator, the assignee, AND the owner of the rule.

I know how to specify the Initiator and assignee.  How do I specify the owner of the rule in the CC?

2 answers

2 accepted

0 votes
Answer accepted
Darryl Lee
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 6, 2024

There's always an API. It's just that some of them aren't documented (and probably not supported for what you're asking). Or you probably shouldn't bother (skip to the end of my post!) :-}

But heh it's fun to go digging. Turns out there is an API endpoint that would let you see the JSON behind your rule, where you could get the authorAccountId:

 "authorAccountId": "123456:fffffff-ff11-ff11-11ff-ff11ff11ff11ff",

Here's the endpoint:

https://YOURSITE.atlassian.net/gateway/api/automation/internal-api/jira/YOURSITEID/pro/rest/GLOBAL/rule/YOURRULEID

Ok, YOURSITE should be pretty self-explanatory. And YOURRULEID is there in the URL when you are editing your rule.

The tricky part would be YOURSITEID. Probably the easiest way to find that is to Export your rule and look for the ruleScope where you will see something like:

 "ruleScope": {
"resources": [
"ari:cloud:jira::site/ffff1234-f123-12ff-ff1f-fffffffff"
]
},

So yeah, IN THEORY you could use the good old web request trick to hit the API endpoint, and then get in the authorAccountId. BUT THEN you would have to make another web request to get the email, because there's now way to get that from a UserId (thanks a LOT EU :-P). Basically like this: Populate a user picker field from the description field except your URL would be

https://YOURSITE.atlassian.net/rest/api/2/user/search?accountId={{webResponse.body.accountAuthorID}}

BUT WAIT! How often is the Owner of your Rules changing? Why can't you just manually add/update them as Cc'ed users? I realize that's not very elegant. But trying to understand how often this happens. (Also you'd have to lookup the Rule ID for every rule where you do this, so again, that feels like way more work than just typing in the Owner's email.)

Or maybe you wanted this functionality to be generally available to all of your rules, or if you copy rules and assign different owners? In which case, yes, Bill's right about voting for AUTO-76.

As always, probably more work than it's wroth to use the APIs for this, but always fun to explore a bit.

Cash Coyne
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.
February 13, 2024

You definitely did a deep dive!

I have a lot of rules and have me BCC'd on a lot of them, but if I want someone else to take them over, I'd have to change all the BCC's to that person.

What you propose may work, but it's more work than manually changing each rule's BCC, so I'll probably do that.

If I don't want to do that, I'll probably go with @Nikola Perisic 's suggestion and just create a group and BCC to the group. 

Like Nikola Perisic likes this
0 votes
Answer accepted
Nikola Perisic
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 6, 2024

Hello @Cash Coyne 

There isn't a direct way to get the rule owner. Also, there is no API that can fetch this data.

Workaround would be to create a group for example automation-rule-owners and put all of the users (if there are more admins) to be the part of this group then to CC them.

Otherwise, there is no other way.

Bill Sheboy
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.
February 6, 2024

Hi @Cash Coyne 

That is not supported for rules yet, and here are two related suggestions you may want to watch / vote for.  One specifically notes adding the ability to email rule owners with the Send Email action.

https://jira.atlassian.com/browse/AUTO-76

https://jira.atlassian.com/browse/AUTO-109

Kind regards,
Bill

Like Cash Coyne likes this
Cash Coyne
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.
February 13, 2024

@Nikola Perisic , your solution is probably the most straight forward.  Thanks.

Like Nikola Perisic likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events