How to run a job in Jenkins when user comment in Jira
Hello Ashish,
You can use JIRA Webhooks to properly notify a script to trigger the build creation in Jenkins when an issue is commented:
Comment webhooks
- created (
comment_created
)- updated (
comment_updated
)- deleted (
comment_deleted
)
You can check more information about webhooks in the documentation below:
Additionally, the app below provide you with the ability to create builds directly from JIRA, so you would only need to create a script to receive Jira webhook and trigger the creation of the build:
- Jenkins Integration from JIRA
Let me know if this information helps.
Hi Petter,
Thanks for the above information, it was very useful.
I am able to see Jenkin's job in Jira but how do I trigger those jobs through Jira.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Ashish,
You can trigger the Jenkins builds by simply clicking to do it in the Issue view, as displayed in the screenshot below:
However, per your description, I believe you want it to be triggered automatically upon an issue comment. Since the plugin does not provide this kind of functionality, you will need to create a script to properly trigger those jobs, using the REST API of Jenkins and JIRA Webhooks, as mentioned before:
In fact, you will need some dev skills to accomplish that. I must confess that I'm not a Jenkins specialist, so you will need to dig a little bit further in Jenkins REST API to develop the Script.
Let me know if there is anything else I can help.
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.