Skip to content

Transition Jira Issue to In Progress #111

Transition Jira Issue to In Progress

Transition Jira Issue to In Progress #111

name: Transition Jira Issue to In Progress
on:
create:
branches:
- '*'
jobs:
transition-issue:
runs-on: ubuntu-latest
steps:
- name: Extract issue key
id: extract-key
run: echo "::set-output name=issue_key::$(echo ${{ github.ref }} | grep -oE '([A-Z]+-\d+)')"
- name: Transition Jira issue to In Progress
if: steps.extract-key.outputs.issue_key
run: |
curl -X POST -u ${{ secrets.JIRA_USERNAME }}:${{ secrets.JIRA_API_TOKEN }} \
-H "Content-Type: application/json" \
--data '{"transition": {"id": "11"}}' \
https://<your-jira-domain>.atlassian.net/rest/api/2/issue/${{ steps.extract-key.outputs.issue_key }}/transitions
env:
JIRA_USERNAME: ${{ secrets.JIRA_USERNAME }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}