We have an Automation Rule that typically triggers when a release gets released. However, I'm automating this process in the sense that, a github workflow creates the release and releases it using `https://***.atlassian.net/rest/api/3/version` and for some reason, this doesn't trigger the Automation Rule.
Why is that? Shouldn't the automation rule be executed whenever a release gets created regardless of whether it was made manually through JIRA UI or the RestAPI?
Hi @Ismaeil Ghouneim -- Welcome to the Atlassian Community!
To confirm, is this the Jira REST API endpoint you are using:
Did you confirm the version was created successfully in the project?
Is your automation rule defined / scoped in the same project where the version was created?
As an experiment in one single Jira project, I used one automation rule to call the REST API to create a version and a second one to detect that a version was created, and both worked as expected.
Kind regards,
Bill
Thanks for answering Bill.
Pretty much yes, the release gets created successfully using this mentioned REST API and the rule is defined in the same project (that's why it works fine when the release is created via the UI). But the rule doesn't execute. I even had a look at the Audit Log and it's not there.
I even now tried using cURL directly to create the release via the API and it does the same behaviour, creates the release no problem but the trigger never gets executed.
FIX_VERSION="****"
CREATE_PAYLOAD="{\"name\":\"***\",\"project\":\"***\",\"releaseDate\":\"$(date +%F)\",\"released\": true}"
curl -X POST -v -H "Content-Type: application/json" -u "jira_token" -d "${CREATE_PAYLOAD}" https://******.atlassian.net/rest/api/3/version
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I just tried using Postman and the version create was correctly detected to trigger a rule, so it does not seem to an active problem / incident. Perhaps try the same thing as that would eliminate an issue with your call.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Aha! For anyone interested, I figured out what the issue was.
The order of my workflow execution was as follows:
Apparently for JIRA, this creates an-already-released version which for some reason doesn't make the automation rule detect it. You see the trigger here basically works when an unreleased version is released. In short, the automation rule is triggered by the PUT method.
The order of execution that makes it work:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That is interesting...I tried both: released: false and true.
As long has you have it working now, that is great!
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.