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?
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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Nikola Perisic , your solution is probably the most straight forward. Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.