File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : ' Transition Jira Issue'
2+ description : ' Transition Jira Issue'
3+ inputs :
4+ token :
5+ description : " Token to connect to Jira"
6+ required : true
7+ issue-key :
8+ description : " Issue Key"
9+ required : true
10+ transition-id :
11+ description : " Id of Transition"
12+ required : true
13+ resolution :
14+ description : " Resolution of Transition"
15+ runs :
16+ using : " composite"
17+ steps :
18+ - id : find
19+ shell : bash
20+ env :
21+ JIRA_API_TOKEN : ${{ inputs.token }}
22+ ISSUE_KEY : ${{ inputs.issue-key }}
23+ TRANSITION_ID : ${{ inputs.transition-id }}
24+ RESOLUTION : ${{ inputs.resolution }}
25+ run : |
26+ request=$(jq -n --arg transition_id "$TRANSITION_ID" '{"transition":{"id":$transition_id}}')
27+ if [[ -n "$RESOLUTION" ]]; then
28+ request=$(echo $request | jq --arg resolution "$RESOLUTION" '[.,{fields:{resolution:{name:$resolution}}}] | add')
29+ fi
30+ echo "REQUEST=${request}"
31+ json_response=$(curl --request POST \
32+ --url "https://jira.mongodb.org/rest/api/2/issue/$ISSUE_KEY/transitions" \
33+ --header 'Authorization: Bearer '"${JIRA_API_TOKEN}" \
34+ --header 'Accept: application/json' \
35+ --header 'Content-Type: application/json' \
36+ --data "$request" \
37+ -v)
38+ echo "RESPONSE=${json_response}"
You can’t perform that action at this time.
0 commit comments