I want to integrate my JIRA cloud with my Github account. Whenever I put JIRA ticket id in my commit message I want to check if that ticket id is open or closed. If the id is closed then the commit should fail. How can I do that?
Hi Sunil,
I understand that you are using Jira Cloud and you want to be able to use the status of a Jira issue to automatically reject a commit from github containing that Jira issuekey. Within Jira Cloud, I have not yet found a way to do this. I also have not found a means in our Marketplace for a third party app that can do this either.
I tried to see if there was a way to do this with Jira Cloud's own automation, and while there are smart values for development data such as {{commit.url}}, this information by itself doesn't seem like enough to do what you want here.
I found that automation could trigger an automation rule upon a commit, and setup a condition to check the status of the issue in Jira, but the actions available to us such as Send a Web request (aka webhook) seems like the closest I could get here. If there was a specific webhook URL/payload that github would accept that Jira could make to reject that specific PR/commit, then perhaps you could get this to work. However in my own testing I wasn't able to identify a specific means to do this within Github. If you have never used automation in Jira Cloud, I'd recommend starting with Automate your Jira Cloud processes and workflows for some help playing around with this if you want to try to explore this option for yourself.
In researching this topic, I did come across a different idea to try here instead. The concept is called 'pre-receive hook script', which seems to do what I think you want here. There are some details about this over in https://help.github.com/en/enterprise/2.18/admin/developer-workflow/creating-a-pre-receive-hook-script I think this second option looks to be much more promising, however it seems that this is specifically for Enterprise Server version of Github. So this might not be applicable to other platforms of Github, but I wanted to at least share with you what I found on the topic.
I hope this helps.
Andy
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.