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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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 ****[https://api.github.com/repos/OWNER/REPO/issues](<https://api.github.com/repos/OWNER/REPO/issues>) \\
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}}
in the log message and save the action.{{webhookResponse.body.number}}
in the Audit log.{{webhookResponse.body.number}}
and save the Create Variable action.{{githubnumber}}
{{webhookResponse.status}}
and save the action.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
and save the conditionPaste the GitHub Repository url in the Web request URL and it should be in the format ****[https://api.github.com/repos/OWNER/REPO/](<https://api.github.com/repos/OWNER/REPO/issues>)issues/{{issue.customfield_10073}}/comment
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.
{ "body": "<b> Internal comment </b> \\n\\n\\n {{comment.body.jsonEncode}}" }
Note: jsonEncode
will convert the text into JSON format and GitHub accepts JSON.
https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/#Json-encoding
Toggle the below two options of wait for response. These responses can be used for further automation components.
{{comment.internal}}
Equals
false
and save the conditionPaste the GitHub Repository url in the Web request URL and it should be in the format ****[https://api.github.com/repos/OWNER/REPO/](<https://api.github.com/repos/OWNER/REPO/issues>)issues/{{issue.customfield_10073}}/comment
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.
{ "body": "<b> Update from the Customer </b> \\n\\n\\n {{comment.body.jsonEncode}}" }
Note: jsonEncode
will convert the text into JSON format and GitHub accepts JSON.
https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/#Json-encoding
Toggle the below two options of wait for response. These responses can be used for further automation components.
Hope this will be helpful for you.
Thank you Atlassian community
Regards,
Siva
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@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)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.