Essentially, spammers are everywhere, and I don't want to have to give all our guys Admin to the project in order to add a sender to the blocklist, has anyone figured out how to run a manual automation that adds the sender to the blocklist for the project?
I'm thinking the Send web request and
https://developer.atlassian.com/cloud/jira/service-desk/basic-auth-for-rest-apis/ with ?? Something, there should be an api call we can make to add a domain or email to the blocklist, right?
Hey, that's a cool idea. Unfortunately the API for adding domains/emails to the blocklist is not public, but hey, that's what Chrome's Developer Tools is for!
DISCLAIMER
Use of Unofficial and Undocumented APIs is NOT RECOMMENDED for any production tasks or Automations. This information is strictly for informational, and possible one-time uses/runs/migrations etc. because they are inherently fragile and may break if Atlassian changes the API.
(On the other hand, it’ll probably be fine.)
So yeah, sniffing around while trying to add an address to my project's blocklist, I found this endpoint:
https://YOURSITE.atlassian.net/rest/jira-email-processor-plugin/1.0/mail/blocklist/create
And the payload is thankfully short and sweet:
{
"projects": [
{
"projectId": "10012",
"creates": [
{
"blockString": "spammer@ihatespammers.ugh",
"isDomain": false
}
]
}
]
}
You'll want to refer to this documentation on how to set up Authorization headers and you definitely will need a content-type header of application/json:
Since the API Token will need to be for a user who has Administrative privileges, once you're sure things are working, you'll want to make sure you make the Authorization header hidden, and for good measure also make sure the editors for the rule is restricted.
To get your project's ID, you can load this up in a web browser:
https://YOURSITE.atlassian.net/rest/api/latest/project/YOURPROJECTKEY
(Where YOURPROJECTKEY = HELP/TECH/BUGS whatever prefixes your issue IDs like HELP-123, TECH-234, or BUGS-345.)
ID will be up at the top after "id":
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
One last note about the unnofficial nature of this API endpoint.
The same path is "unofficially" documented by Atlassian here for Server/DC:
And here for Cloud with Automation:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.