.
Hi @Siva Nagendra,
Welcome to the Community!
What exactly are you wanting to make a comment on in Github based on a comment being made in Jira?
For the most part I don't believe Jira Automations directly support adding comments to things like Pull Requests. However, you can send a web request through an automation rule if there is an API on the Github side that would be able to receive and perform the action you want.
I hope that helps!
Thank you for responding
Happy new year@Jimmy Seddon
>What exactly are you wanting to make a comment on in Github based on a comment being made in Jira?
I have built an automation rule to create an issue in GitHub repository automatically when an issue is created in Jira(JSM) using GitHub REST API.
In the same way when an issue is commented in Jira then automatically the comment should be added to issue in GitHub.This is the usecase I wanted to achieve.
I don't think a Jira Automation rule is going to achieve what you want. I think you might have more success triggering a webhook and using that to call your automation script.
@Siva Nagendra hi! There 3rd party tools that can help you achieve that. If you're open to the idea of exploring them as an option - feel free to check out ZigiOps, here at the atlassian marketplace. It's a fully no-code integration tool for bi-directional connection. Can be customized to fit various use cases and does not store any of your data. It can help with the jira github integration. If you want to know more - feel free to book a demo slot. It's free and non-binding.
Regards, Diana (ZigiOps team)
Hii @Jimmy Seddon @Diana_Architect_ZigiWave
Thank you for your suggestions. I have already achieved the outcome.
The following are the major steps.
- to create API key.
Step - 1: Create a Custom Number field in the JSM project to store the number from the webhookResponse body i.e issue number which is created in GitHub.
Note: Note down the Number custom field ID which will be used in further steps
https://confluence.atlassian.com/jirakb/how-to-find-id-for-custom-field-s-744522503.html
Step - 2: Create an Automation Rule to create an issue automatically in GitHub when created in Jira
Navigate to the Automation section in Jira Service Management to create an Automation Rule.
Steps to create Automation Rule
Paste the GitHub Repository url in the Web request URL and it should be in the format ****[<a href="https://api.github.com/repos/OWNER/REPO/issues" rel="noopener nofollow noreferrer" target="_blank">https://api.github.com/repos/OWNER/REPO/issues</a>](<<a href="https://api.github.com/repos/OWNER/REPO/issues" rel="noopener nofollow noreferrer" target="_blank">https://api.github.com/repos/OWNER/REPO/issues</a>>) \\
<a href="https://api.github.com/repos/OWNER/REPO/issues" rel="noopener nofollow noreferrer" target="_blank">https://api.github.com/repos/OWNER/REPO/issues</a>](<<a href="https://api.github.com/repos/OWNER/REPO/issues" rel="noopener nofollow noreferrer" target="_blank">https://api.github.com/repos/OWNER/REPO/issues</a>>) \\
Add the following Headers information.
Select the HTTP method as POST.
Select the custom data option in the Web request body and paste the following information in Custom data.
{ "title": "{{issue.key}}({{issue.Organizations}}){{issue.summary.jsonEncode}}", "body": "", "labels": [{{issue.labels.name}}] }
Note: Atlassian ticket link should be changed accordingly.
Toggle the below two options of wait for response. These responses can be used for further automation components.
{{webhookResponse.body.number}}
{{githubnumber}}
{{webhookResponse.status}}
Step - 3: Create an Automation Rule to create a comment and add to the appropriate issue in GitHub when created in Jira.
{{comment.internal}}
Equals
True
Paste the GitHub Repository url in the Web request URL and it should be in the format ****[<a href="https://api.github.com/repos/OWNER/REPO/" rel="noopener nofollow noreferrer" target="_blank">https://api.github.com/repos/OWNER/REPO/</a>](<<a href="https://api.github.com/repos/OWNER/REPO/issues" rel="noopener nofollow noreferrer" target="_blank">https://api.github.com/repos/OWNER/REPO/issues</a>>)issues/{{issue.customfield_10073}}/comment
<a href="https://api.github.com/repos/OWNER/REPO/" rel="noopener nofollow noreferrer" target="_blank">https://api.github.com/repos/OWNER/REPO/</a>](<<a href="https://api.github.com/repos/OWNER/REPO/issues" rel="noopener nofollow noreferrer" target="_blank">https://api.github.com/repos/OWNER/REPO/issues</a>>)issues/{{issue.customfield_10073}}/comment
{ "body": "<b> Internal comment </b> \\n\\n\\n {{comment.body.jsonEncode}}" }
Note: jsonEncode will convert the text into JSON format and GitHub accepts JSON.
jsonEncode
https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/#Json-encoding
false
{ "body": "<b> Update from the Customer </b> \\n\\n\\n {{comment.body.jsonEncode}}" }
Hope this will be helpful for you.
Thank you Atlassian community
Regards,
Siva
Hi @Siva Nagendra ,
I am Dhiren from the Exalate Team.
I would recommend you to try out Exalate
It is one-of-a-kind decentralized and fully bidirectional integration solution which can help you in syncing Jira Issues with GitHub Issues bidirectionally.
You can sync all the fields from GitHub Issues like Subject, Desc, Comments, Status, Labels, and even Assignee.
You can even automate the process of syncing tickets by using triggers.
Do let me know if you have any questions or would like to know more about the product.
Thanks, Dhiren
It looks like you're new here. Sign in or register to get started.