Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SNOW-422709 Make jira_close workflow use gajira-transition #827

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 40 additions & 6 deletions .github/workflows/jira_close.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,55 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Jira login
uses: atlassian/gajira-login@master

- name: Jira Login
uses: atlassian/[email protected]
env:
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}

- name: Extract issue from title
id: extract
env:
TITLE: "${{ github.event.issue.title }}"
TITLE: ${{ github.event.issue.title }}
run: |
jira=$(echo -n $TITLE | awk '{print $1}' | sed -e 's/://')
echo ::set-output name=jira::$jira

- name: Close issue
uses: ./.github/actions/gajira-close
uses: kushanzaveri/gajira-transition@add-fields-support
if: startsWith(steps.extract.outputs.jira, 'SNOW-')
with:
issue: "${{ steps.extract.outputs.jira }}"
issue: ${{ steps.extract.outputs.jira }}
transition: 'MOVE TO DONE'
fields: '{
"customfield_12860": {"id": "11506"},
"customfield_10800": {"id": "-1"},
"customfield_12500": {"id": "11302"},
"customfield_12400": {"id": "-1"},
"resolution": {"id": "6"}
}'
update: '{
"comment": [
{
"add": {
"body" : {
"version": 1,
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Closed on GitHub"
}
]
}
]
}
}
}
]
}'
Comment on lines +43 to +64
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Took me a while to figure out how to do this - see https://developer.atlassian.com/cloud/jira/platform/apis/document/structure/