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:
https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-project-versions/#api-rest-api-3-version-post
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
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.
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:
It looks like you're new here. Sign in or register to get started.