JIRA webhook & Github API

October 13, 2022

========================================= JIRA webhook to Github setup..

curl -u "${USER_NAME}:${PERSONAL_TOKEN}" https://api.github.com/repos/${OWNER|ORGANIZATION}/${REPO}/issues -d ${JSON_STRING}
OR
curl -H "Accept: application/vnd.github+json" -H "Authorization: token <TOKEN>" https://api.github.com/issues -d ${JSON_STRING}

?? how to auth via username and personal token using header? ==> curl -H “Accept: application/vnd.github+json” -H “Authorization: Basic <base64(${USER_NAME:${PERSONAL_TOKEN}})>” https://api.github.com/issues -d ${JSON_STRING}

You can use online base64 encoder.

==> user_name:personal_token ==Base64 Encoding==> Authorization: Basic Encoding_data

========================================

custom json data:

{ “title”: ”{{ issue.key }} {{ issue.fields.summary }}”, “body”: ”{{ issue.fields.issuetype.name }}\n---\n {{ issue.fields.description.jsonEncode }} \n---\n …created by {{ issue.fields.reporter.displayName }}”, “labels”: [“from jira”] }

** JIRA 디스크립션은 유니코드라 jsonEncoding 해야됨**

[refs] https://docs.github.com/en/rest/issues/issues#create-an-issue https://docs.github.com/en/rest/issues/issues#list-issues-assigned-to-the-authenticated-user https://community.atlassian.com/t5/Jira-articles/Automation-for-Jira-Send-web-request-using-Jira-REST-API/ba-p/1443828 https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/#finding-your-smart-value https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/

  • JIRA data API

https://${SPACE_NAME}.atlassian.net/rest/api/2/issue/${JIRA-TICKET-NUM}



Profile picture

Written by Yerin Hong who lives in London and works in the UK.