Hi Atlassian Community,
In our previous post we announced our new Rule Management APIs available for testing. Today we’re excited to announce that the Automation Rule Management API has graduated from Early Access and is now Generally Available (GA) for all customers! 🎉
This release brings new capabilities for managing automation at scale, making it easier than ever for admins and developers to programmatically control rule configurations across your Jira sites
Here are some practical API use cases and examples to help you get started:
Export a rule using the “get a rule by UUID” API:
curl --request GET \
--url '{baseSiteURL}/gateway/api/automation/public/jira/{cloudid}/rest/v1/rule/{ruleUuid}' \
--header 'Accept: application/json' \
--header 'Authorization: {authorisationToken}'
To import (clone) a rule, remove the uuid field from the payload if importing into the same site, then use:
curl --request POST \
--url '{baseSiteURL}/gateway/api/automation/public/jira/{cloudid}/rest/v1/rule' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: {authorisationToken}' \
--data '{ ... }'
To update the scope of multiple rules (e.g., after creating a new project):
Search for rules by scope:
curl --request POST \
--url '{baseSiteURL}/gateway/api/automation/public/jira/{cloudid}/rest/v1/rule/summary' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: {authorisationToken}' \
--data '{ "scope": "ari:cloud:jira:{cloudId}:project/10001" }'
Update rule scope for each rule:
curl --request PUT \
--url 'https://api.atlassian.com/automation/public/{product}/{cloudid}/rest/v1/rule/{ruleUuid}/rule-scope' \
--header 'Content-Type: application/json' \
--header 'Authorization: {authorisationToken}' \
--data '{ "ruleScopeARIs": [ "ari:cloud:jira:{cloudId}:project/10001", "ari:cloud:jira:{cloudId}:project/{newProjectId}" ] }'
To update a set of rules (e.g., after a field rename):
Search for rules by trigger:
curl --request POST \
--url '{baseSiteURL}/gateway/api/automation/public/jira/{cloudid}/rest/v1/rule/summary' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: {authorisationToken}' \
--data '{ "trigger": "jira.incoming.webhook" }'
For each rule, fetch details, edit as needed, and update:
curl --request PUT \
--url 'https://api.atlassian.com/automation/public/{product}/{cloudid}/rest/v1/rule/{ruleUuid}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{ "rule": {updatedRuleConfig} }'
Check out the developer documentation for how to get started.
Have questions or want to share how you’re using the API? Drop your thoughts in the comments below. Your feedback helps us shape future improvements.
Thanks for being part of the Atlassian Community!
Scott Bell
1 comment