I'm wondering if there is a way for a change in status on jira issue to trigger a github action, like merging a pull request.
I know you can use webhooks to send PR information to linked jira issues and change the issue status, I'm wondering if the reverse can be done. Can jira send information back to github?
Hello @Victoria Lee ,
Welcome to the Atlassian Community!
If I understand correctly you would like to trigger a github action automatically, when an issue in Jira changes status.
Now, if my understanding is correct, you should be able to achieve this by creating an Automation Rule (either global or specific to a project) that on the desired status change will send a REST API request to, for example, the GitHub Pull Request API (allows you to list, view, edit, create, and even merge pull requests. Comments on pull requests can be managed via the Issue Comments API).
For further details and examples please see:
I hope this helps.
Cheers,
Dario
Hi Dario
have a question, do i need to setup a webhook to send payload to GitHub Repo from JIRA?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Hemant Goel ,
As I have written in my comment before you need to use an Automation Rule:
[...] you should be able to achieve this by creating an Automation Rule (either global or specific to a project) that on the desired status change will send a REST API request to, for example, the GitHub Pull Request API [...]
This is because, as you can read in below feature request, Jira Webhooks do not support authentication:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thanks @Dario B
appreciate your quick response. I got your point but when i set up an action, i do get only option as Submit Web Request and that only asks for WebHooks. I tried to provide RestAPI URL which works locally with me, but in Jira i always get 404 response. Is there any other action i should try for RestAPI.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please notice that 404 means page not found and therefore there are chances you are calling the wrong URL. Also, I don't see any authorization header configured.
Can you confirm that you are trying to call the below endpoint?
If that's correct, can you run the same REST API call using Curl as per the example in above page and paste the result in here (making sure to remove all the sensitive data like username, auth token, auth header, etc).
curl \ -H "Accept: application/vnd.github.v3+json" \ -H "Authorization: token <TOKEN>" \ https://api.github.com/repos/OWNER/REPO/actions/runs
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks @Dario B
As i need to fetch data from a organization repo, so had to use this URL:
https://api.github.com/repos/tr/DellBoomi_Test/actions/workflows
and getting response (not adding full response here)
{
"total_count": 10,
"workflows": [
{
"id": 24466375,
"node_id": "W_kwDOEt2HOs4BdVPH",
"name": "API test",
"path": ".github/workflows/API.yml",
"state": "active",
"created_at": "2022-04-19T16:56:49.000+01:00",
"updated_at": "2022-05-17T11:43:10.000+01:00",
"url": "https://api.github.com/repos/tr/DellBoomi_Test/actions/workflows/24466375",
"html_url": "https://github.com/tr/DellBoomi_Test/blob/master/.github/workflows/API.yml",
"badge_url": "https://github.com/tr/DellBoomi_Test/workflows/API%20test/badge.svg"
},
Curl command I used:
curl -i -H "Accept: application/vnd.github.v3+json" -H "Authorization: token [token]" https://api.github.com/repos/tr/DellBoomi_Test/actions/workflows
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
And with runs option also getting good response
curl -i -H "Accept: application/vnd.github.v3+json" -H "Authorization: token [token]" https://api.github.com/repos/tr/DellBoomi_Test/actions/runs
{
"total_count": 389,
"workflow_runs": [
{
"id": 2516519596,
"name": "Get_Extension",
"node_id": "WFR_kwLOEt2HOs6V_wqs",
"head_branch": "testbranch",
"head_sha": "a994b74d3a5dbd7665004c96dc9532190f5b55b0",
"path": ".github/workflows/getAPI.yml",
"run_number": 15,
"event": "push",
"status": "completed",
"conclusion": "failure",
"workflow_id": 28156276,
"check_suite_id": 6981026234,
"check_suite_node_id": "CS_kwDOEt2HOs8AAAABoBoBug",
"url": "https://api.github.com/repos/tr/DellBoomi_Test/actions/runs/2516519596",
"html_url": "https://github.com/tr/DellBoomi_Test/actions/runs/2516519596",
"pull_requests": [
{
"url": "https://api.github.com/repos/tr/DellBoomi_Test/pulls/10",
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I can get the response using this as well:
https://api.github.com/repos/tr/DellBoomi_Test/actions/workflows
{
"total_count": 10,
"workflows": [
{
"id": 24466375,
"node_id": "W_kwDOEt2HOs4BdVPH",
"name": "API test",
"path": ".github/workflows/API.yml",
"state": "active",
"created_at": "2022-04-19T16:56:49.000+01:00",
"updated_at": "2022-05-17T11:43:10.000+01:00",
"url": "https://api.github.com/repos/tr/DellBoomi_Test/actions/workflows/24466375",
"html_url": "https://github.com/tr/DellBoomi_Test/blob/master/.github/workflows/API.yml",
"badge_url": "https://github.com/tr/DellBoomi_Test/workflows/API%20test/badge.svg"
},
{
"id": 26215799,
"node_id": "W_kwDOEt2HOs4BkAV3",
"name": "Main_pipeline",
"path": ".github/workflows/Main_Pipeline.yml",
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try if adding the authorization header to the automation rule makes any difference.
If it doesn't, expand the error message and check the automation rule logs for more details on what's failing.
Finally, if nothing helps, it could be a good idea to create a support request using below link in order to have your issue investigated:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Dario B first of all many thanks for your support and a big apology from my end, i found the mistake was making during this run, forgot to pick right HTTP method according to different API, now its all sorted and working fine. Thanks a lot.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Nice one @Hemant Goel ! Mistakes happens, the important thing is that this is now working :)
Have a nice day!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi @Hemant Goel i am also looking for jira issue status change like status changed from inprogress to closed , or resolution comments are added to jira , it should close the curesponding pr /issue for the github event
i am creating jira issue from githubactions on the event of pr created/ issue created .
once issue is created any update to jira issue should reflect in github as well .
i am use github-jira as label for jira issues
i configured jira automation rule as
audit logs of automation rule has
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.