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

Nd 271 spike dependabot ticket auto creation in jira #420

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
173 commits
Select commit Hold shift + click to select a range
f2f8c50
ND-271 Ammended the trigger for PR automation
sb21460 Jan 9, 2025
91869aa
ND-271 Added the version of yml to solve the error
sb21460 Jan 9, 2025
d9476b5
ND-271 corrected the version of yml to resolve the error
sb21460 Jan 9, 2025
39ddd44
ND-271 amended the version of yml to resolve the error
sb21460 Jan 9, 2025
63ea25b
Updated the project code ND-271
sb21460 Jan 9, 2025
87be1aa
Updated the project code to DISO DevOps ND-271
sb21460 Jan 9, 2025
ba5c042
Updated the project code to ND ND-271
sb21460 Jan 9, 2025
33a8574
Included the criteria to check for dependabot tickets ND-271
sb21460 Jan 9, 2025
531c14a
Updated the criteria to check for dependabot tickets ND-271
sb21460 Jan 9, 2025
eb99f9c
Updated the criteria (github.event.pull_request.user.login) to check …
sb21460 Jan 9, 2025
3f4d3c7
Updated the criteria (github.event.pull_request.user.login) to check …
sb21460 Jan 9, 2025
9d052c9
Updated the criteria (github.event.pull_request.user.login) to check …
sb21460 Jan 9, 2025
e2cf6d2
Updated the criteria (github.event.pull_request.user.login) to check …
sb21460 Jan 9, 2025
13f343e
ND-271 added jira project as environmental variable
sb21460 Jan 9, 2025
bc2eaaa
ND-271 removed Jira project parameter
sb21460 Jan 9, 2025
e65f398
ND-271 removed Jira project parameter
sb21460 Jan 9, 2025
8803af1
ND-271 updated Jira project parameter
sb21460 Jan 9, 2025
67171b2
updated the project id to 15280
sb21460 Jan 15, 2025
a442a67
updated the project key to ND'
sb21460 Jan 16, 2025
789af28
Corrected the workflow to rectify the errors
sb21460 Jan 16, 2025
f99e7ee
Modified the description to add PR details to Jira ticket created
sb21460 Jan 20, 2025
411e32d
Updated the user to test for dependabot
sb21460 Jan 20, 2025
22124ef
ND-271 updated the create jira section to include dependabot details
sb21460 Jan 20, 2025
5d8d373
ND-271 removed the user check to test
sb21460 Jan 20, 2025
4f3da1b
created a workflow to list all PR's for test purpose
sb21460 Jan 21, 2025
cf7ccd7
updated the workflow to edit the trigger
sb21460 Jan 21, 2025
a6dca90
updated the permissions to allow writting comments in github
sb21460 Jan 21, 2025
72996e4
removed the code to fetch dependabot meta data
sb21460 Jan 21, 2025
3cdc8e2
reverted to test earlioer commit
sb21460 Jan 22, 2025
89ccef3
Updated the trigger for the workflow
sb21460 Jan 22, 2025
37d8a16
Updated the trigger for the workflow
sb21460 Jan 22, 2025
4858f68
Updated the trigger for the workflow
sb21460 Jan 22, 2025
3d08d91
Updated the trigger for the workflow
sb21460 Jan 22, 2025
32d6578
Updated the include multiple PR's in the ticket description
sb21460 Jan 22, 2025
7d2ec73
Updated the include multiple PR's in the ticket description
sb21460 Jan 22, 2025
a0ac0be
Added github token to allow access for Github CLI
sb21460 Jan 22, 2025
09e5fe9
Edited the description of jira ticket to diaplay all PR's
sb21460 Jan 22, 2025
391cc45
Edited the description of jira ticket to diaplay all PR's
sb21460 Jan 22, 2025
4aad288
Edited the description of jira ticket to diaplay all PR's
sb21460 Jan 22, 2025
450e3af
Edited the description of jira ticket to diaplay all PR's
sb21460 Jan 22, 2025
1e12433
Edited the description of jira ticket to diaplay all PR's
sb21460 Jan 22, 2025
9d936dd
Updated tyhe PR's display format
sb21460 Jan 22, 2025
20dd07b
Updated tyhe PR's display format
sb21460 Jan 22, 2025
fdc243b
corrected tyhe trigger error
sb21460 Jan 22, 2025
5d9f2a7
corrected the error on line 31
sb21460 Jan 22, 2025
74cd585
corrected the error on line 31
sb21460 Jan 22, 2025
807214c
corrected the error on line 31
sb21460 Jan 22, 2025
534ee33
corrected the error on line 31
sb21460 Jan 22, 2025
4ec109a
corrected the error on line 31
sb21460 Jan 22, 2025
b3e2ea1
corrected the error on line 31
sb21460 Jan 22, 2025
f3f117f
corrected the error on line 31
sb21460 Jan 22, 2025
ba12559
corrected the error on line 31
sb21460 Jan 22, 2025
f035af4
corrected the errors
sb21460 Jan 22, 2025
2649175
Updated the format of description
sb21460 Jan 22, 2025
656a12e
Updated the format of description
sb21460 Jan 22, 2025
8dac977
Updated the format of description
sb21460 Jan 22, 2025
b4efb6d
Updated the format of description
sb21460 Jan 22, 2025
b6cdf6e
Updated the format of description
sb21460 Jan 22, 2025
3444356
Updated the format of description
sb21460 Jan 22, 2025
45a0424
Updated the format of description
sb21460 Jan 22, 2025
c748008
Updated the format of description
sb21460 Jan 22, 2025
1be7bd4
Updated the format of description
sb21460 Jan 22, 2025
3e61fe3
Updated the format of description
sb21460 Jan 22, 2025
b0abd85
Updated the format of description
sb21460 Jan 22, 2025
761ab53
Updated the format of description
sb21460 Jan 22, 2025
3752cb4
Updated the format of description
sb21460 Jan 22, 2025
00b35b1
Updated the format of description
sb21460 Jan 22, 2025
ad02917
Updated the format of description
sb21460 Jan 22, 2025
ea56558
Updated the format of description
sb21460 Jan 22, 2025
e9e7cf3
Updated the format of description
sb21460 Jan 22, 2025
6fc099c
Updated the format of description
sb21460 Jan 22, 2025
f0b99fc
Updated the format of description
sb21460 Jan 22, 2025
aff2e70
Updated the format of description
sb21460 Jan 22, 2025
65f25b7
Updated the format of description
sb21460 Jan 22, 2025
30433d2
Updated the format of description
sb21460 Jan 22, 2025
1a63b12
Updated the format of description
sb21460 Jan 22, 2025
0979d08
Updated the format of description
sb21460 Jan 22, 2025
eeafaf7
ND-271 Updated the format of description
sb21460 Jan 22, 2025
7fe1eec
ND-271 Updated the format of description
sb21460 Jan 22, 2025
8926cef
ND-271 Updated the format of description
sb21460 Jan 22, 2025
4bb4f76
ND-271 Updated the format of description
sb21460 Jan 22, 2025
514d4a9
ND-271 Updated the format of description
sb21460 Jan 22, 2025
d25acb1
ND-271 Updated the format of description
sb21460 Jan 22, 2025
729a3e5
ND-271 Updated the format of description
sb21460 Jan 22, 2025
8b22d22
ND-271 Updated the format of description
sb21460 Jan 22, 2025
8dc8c0f
ND-271 Updated the format of description
sb21460 Jan 22, 2025
fa48cb5
ND-271 Updated the ticket to include the functionality of updating or…
sb21460 Jan 22, 2025
bf101c4
ND-271 Updated the ticket to include the functionality of updating or…
sb21460 Jan 22, 2025
8012fdb
ND-271 Updated the ticket to include the functionality of updating or…
sb21460 Jan 22, 2025
5defef6
ND-271 Updated the ticket to include the functionality of updating or…
sb21460 Jan 22, 2025
b40b398
ND-271 Updated the ticket to include the functionality of updating or…
sb21460 Jan 23, 2025
d75c2f1
ND-271 Updated the ticket to include the functionality of updating or…
sb21460 Jan 23, 2025
df8b61f
ND-271 Updated the ticket to include the functionality of updating or…
sb21460 Jan 23, 2025
3987076
ND-271 Updated the ticket to include the functionality of updating or…
sb21460 Jan 23, 2025
21314ab
ND-271 Updated the ticket to include the functionality of updating or…
sb21460 Jan 23, 2025
30800ee
ND-271 Updated the ticket to include the functionality of updating or…
sb21460 Jan 23, 2025
1c8ee11
ND-271 Updated the ticket to include the functionality of updating or…
sb21460 Jan 23, 2025
eb39fbf
ND-271 Updated the ticket to include the functionality of updating or…
sb21460 Jan 26, 2025
dd38410
ND-271 Updated the ticket to include the functionality of updating or…
sb21460 Jan 26, 2025
5c92ebf
ND-271 Updated the ticket to include the functionality of updating or…
sb21460 Jan 26, 2025
1ceba70
ND-271 Updated the ticket to include the functionality of updating or…
sb21460 Jan 26, 2025
ce5578e
ND-271 Updated the ticket to include the functionality of updating or…
sb21460 Jan 27, 2025
c0cd16a
ND-271 Updated the ticket to include the functionality of updating or…
sb21460 Jan 27, 2025
23081e3
ND-271 Updated the ticket to include the functionality of updating or…
sb21460 Jan 27, 2025
d6ad865
ND-271 Updated the ticket to include the functionality of updating or…
sb21460 Jan 27, 2025
df922d0
ND-271 Updated the ticket to include the functionality of updating or…
sb21460 Jan 27, 2025
44ecb8e
ND-271 Updated the ticket to include the functionality of updating or…
sb21460 Jan 27, 2025
80ab9dc
ND-271 Updated the ticket to include the functionality of updating or…
sb21460 Jan 27, 2025
12a963d
ND-271 Updated the ticket to include the functionality of updating or…
sb21460 Jan 27, 2025
778fb76
ND-271 Updated the ticket to include the functionality of updating or…
sb21460 Jan 27, 2025
6e2f284
ND-271 Updated the ticket to include the functionality of updating or…
sb21460 Jan 27, 2025
018d383
ND-271 Updated the ticket to include the functionality of updating or…
sb21460 Jan 27, 2025
c5c11a4
ND-271 Updated the ticket to include the functionality of updating or…
sb21460 Jan 27, 2025
c65c177
ND-271 Updated the ticket to include the functionality of updating or…
sb21460 Jan 27, 2025
53f219c
ND-271 Updated the ticket to include the functionality of updating or…
sb21460 Jan 27, 2025
9baa535
ND-271 Updated the ticket to include the functionality of updating or…
sb21460 Jan 27, 2025
5a935c8
ND-271 Updated the ticket to include the functionality of updating or…
sb21460 Jan 27, 2025
17443eb
ND-271 Updated the ticket to include the functionality of updating or…
sb21460 Jan 27, 2025
e5a8e4b
ND-271 Updated the ticket to include the functionality of updating or…
sb21460 Jan 27, 2025
cd409fa
ND-271 Updated the ticket to include the functionality of updating or…
sb21460 Jan 27, 2025
8d3429a
ND-271 Updated the ticket to include the functionality of updating or…
sb21460 Jan 27, 2025
f2c5854
ND-271 Updated the ticket to include the functionality of updating or…
sb21460 Jan 27, 2025
8386606
ND-271 Updated the ticket to include the functionality of updating or…
sb21460 Jan 27, 2025
022acb3
ND-271 Updated the ticket to include the functionality of updating or…
sb21460 Jan 27, 2025
c3dd969
ND-271 Updated the ticket to include the functionality of updating or…
sb21460 Jan 27, 2025
e4b9f98
ND-271 Updated the ticket to include the functionality of updating or…
sb21460 Jan 27, 2025
0ab631c
ND-271 Updated the ticket to include the functionality of updating or…
sb21460 Jan 27, 2025
db9ba15
ND-271 Updated the ticket to include the functionality of updating or…
sb21460 Jan 27, 2025
70f2468
ND-271 Updated the ticket to include the functionality of updating or…
sb21460 Jan 27, 2025
5582140
ND-271 Updated the ticket to include the functionality of updating or…
sb21460 Jan 27, 2025
5c42cab
ND-271 Updated the ticket to include the functionality of updating or…
sb21460 Jan 27, 2025
88ae294
ND-271 Updated the ticket to include the functionality of updating or…
sb21460 Jan 27, 2025
72d7edb
ND-271 Updated the ticket to include the functionality of updating or…
sb21460 Jan 27, 2025
2e46df8
ND-271 Updated the ticket to include the functionality of updating or…
sb21460 Jan 27, 2025
32ebd1c
ND-271 Updated the ticket to include the functionality of updating or…
sb21460 Jan 27, 2025
2cd8bfe
ND-271 Updated the ticket to include the functionality of updating or…
sb21460 Jan 27, 2025
3fa70a6
ND-271 Updated the ticket to include the functionality of updating or…
sb21460 Jan 27, 2025
a76870d
ND-271 Updated the ticket to include the functionality of updating or…
sb21460 Jan 27, 2025
bde17c7
ND-271 Updated the ticket to include the functionality of updating or…
sb21460 Jan 27, 2025
3a8e11a
ND-271 Updated the ticket to include the functionality of updating or…
sb21460 Jan 27, 2025
7448128
ND-271 Updated the search to look for label Dependabot'
sb21460 Jan 27, 2025
d956cb9
ND-271 Updated the list PR function to include only dependabot PR's
sb21460 Jan 27, 2025
a754fcb
ND-271 Updated the list PR function to include only dependabot PR's
sb21460 Jan 27, 2025
a5f8e1a
ND-271 Updated the list PR function to include only dependabot PR's
sb21460 Jan 27, 2025
98a5b3f
ND-271 Updated the list PR function to include only dependabot PR's
sb21460 Jan 27, 2025
c5265a1
ND-271 debugging the issue id when no dependabot labelled ticket is f…
sb21460 Jan 27, 2025
05d729e
ND-271 debugging the issue id when no dependabot labelled ticket is f…
sb21460 Jan 27, 2025
6f5782b
ND-271 debugging the issue id when no dependabot labelled ticket is f…
sb21460 Jan 27, 2025
596cf74
ND-271 debugging the issue id when no dependabot labelled ticket is f…
sb21460 Jan 27, 2025
2df64d5
ND-271 debugging the issue id when no dependabot labelled ticket is f…
sb21460 Jan 27, 2025
a057ef9
ND-271 debugging the issue id when no dependabot labelled ticket is f…
sb21460 Jan 27, 2025
23f38b7
ND-271 added issue type to new ticket created
sb21460 Jan 27, 2025
f19a2e3
ND-271 corrected the json format for issue creation
sb21460 Jan 27, 2025
5ee592f
ND-271 corrected the json format for issue creation
sb21460 Jan 27, 2025
e38f673
ND-271 added comments
sb21460 Jan 27, 2025
35e8d20
ND-271 added comments
sb21460 Jan 27, 2025
d7fd3b5
ND-271 added comments
sb21460 Jan 27, 2025
2403bbe
ND-271 the find jira ticket step has been split into find, create and…
sb21460 Jan 27, 2025
da4858e
ND-271 corrected the errors
sb21460 Jan 27, 2025
c4ab255
ND-271 corrected the errors
sb21460 Jan 27, 2025
883ca75
ND-271 corrected the errors
sb21460 Jan 27, 2025
82d636c
ND-271 corrected the errors
sb21460 Jan 27, 2025
77c6634
ND-271 added repo name as label
sb21460 Jan 27, 2025
a4d9d8e
ND-271 added repo name as label
sb21460 Jan 27, 2025
38cc015
ND-271 added repo name as label
sb21460 Jan 27, 2025
efb1615
ND-271 added repo name as env variable
sb21460 Jan 27, 2025
6055e25
ND-271 added repo name as env variable
sb21460 Jan 27, 2025
fd3dde0
ND-271 added repo name as env variable
sb21460 Jan 27, 2025
706f05a
ND-271 added repo name as env variable
sb21460 Jan 27, 2025
e54f1ef
ND-271 updated the search criteria
sb21460 Jan 27, 2025
f6c3e69
ND-271 updated the schedule to run monday 4 pm every week
sb21460 Jan 28, 2025
ca33304
ND-271 removed the trigger to run every time code pushed to main
sb21460 Jan 28, 2025
fa2f8be
ND-271 removed the trigger to run every time code pushed to main
sb21460 Jan 28, 2025
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
14 changes: 14 additions & 0 deletions .github/workflows/dependabot-pr-to-jira-trigger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Add Issue to Jira Board with details of Dependabot PR's

on:
schedule:
- cron: '0 16 * * 1' # Runs every Monday at 4 PM UTC

jobs:
call-workflow-dependabot-pr-to-jira:
if: github.ref == 'refs/heads/main'
uses: ministryofjustice/nvvs-devops-github-actions/.github/workflows/dependabot-pr-to-jira.yml@main
secrets:
TECH_SERVICES_JIRA_URL: ${{ secrets.TECH_SERVICES_JIRA_URL }}
TECH_SERVICES_JIRA_EMAIL: ${{ secrets.TECH_SERVICES_JIRA_EMAIL }}
TECH_SERVICES_JIRA_TOKEN: ${{ secrets.TECH_SERVICES_JIRA_TOKEN }}
165 changes: 165 additions & 0 deletions .github/workflows/dependabot-pr-to-jira.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
on:
workflow_call:
secrets:
TECH_SERVICES_JIRA_URL:
description: 'Jira URL passed from the caller workflow'
required: true
TECH_SERVICES_JIRA_EMAIL:
description: 'Email address passed from the caller workflow'
required: true
TECH_SERVICES_JIRA_TOKEN:
description: 'API token passed from the caller workflow'
required: true

jobs:
check-open-prs:
runs-on: ubuntu-latest
name: Create or Update Jira Ticket
steps:

# Step: Set repo name
- name: Set repository name
id: set-repo-name
run: echo "REPO_NAME=$(echo ${{ github.repository }} | cut -d'/' -f2)" >> $GITHUB_ENV

# Step: List open Dependabot PRs on the main branch
- name: List open Dependabot PRs on main branch
id: list-prs
env:
GH_TOKEN: ${{ github.token }}
run: |
# Get a list of open PRs created by 'app/dependabot' or 'dependabot[bot]' and save them to a JSON file
gh pr list --repo ${{ github.repository }} --base main --json number,title,headRefName --search "author:app/dependabot author:dependabot[bot]" > pr_list.json

# Check if the output is valid JSON
if ! jq -e . pr_list.json > /dev/null 2>&1; then
echo "Invalid JSON output from gh pr list"
cat pr_list.json
exit 1
fi

# Step: Format the PRs for Jira ticket description
- name: Format PRs for Jira ticket Description
id: format-prs
run: |
# Format PR details into a description suitable for a Jira issue
PR_DESCRIPTION=$(jq -r '.[] | "- PR Number: \(.number) \nTitle: \(.title) \nBranch: \(.headRefName) \nURL: https://github.com/${{ github.repository }}/pull/\(.number)\n"' pr_list.json | sed ':a;N;$!ba;s/\n/\\n/g')
echo "PR_DESCRIPTION=$PR_DESCRIPTION" >> $GITHUB_ENV

# Step: Find Jira tickets in project ND labeled 'Dependabot'
- name: Find Jira tickets in project ND labeled Dependabot
id: find-jira-ticket
env:
JIRA_URL: ${{ secrets.TECH_SERVICES_JIRA_URL }}
JIRA_API_TOKEN: ${{ secrets.TECH_SERVICES_JIRA_TOKEN }}
JIRA_USERNAME: ${{ secrets.TECH_SERVICES_JIRA_EMAIL }}
run: |
echo "Searching for issues with the 'Dependabot' label in project 'ND'..."
JQL_QUERY='project = ND AND labels in (Dependabot)'
response=$(curl -s -u $JIRA_USERNAME:$JIRA_API_TOKEN \
-X GET \
-H "Content-Type: application/json" \
"$JIRA_URL/rest/api/2/search?jql=project=ND%20AND%20labels%3D%27Dependabot%27")

echo "$response" > jira_search_response.json

issue_count=$(echo "$response" | jq '.issues | length')
echo "Number of issues found: $issue_count"
echo "ISSUE_COUNT=$issue_count" >> $GITHUB_ENV

if echo "$response" | jq -e . >/dev/null 2>&1; then
issue_id=$(echo "$response" | jq -r '.issues[0].key // "null"')
echo "ISSUE_ID=$issue_id" >> $GITHUB_ENV
else
echo "Invalid JSON response"
exit 1
fi

# Step: Create Jira ticket if none found
- name: Create Jira ticket
if: (env.ISSUE_COUNT == 0)
id: create-jira-ticket
env:
JIRA_URL: ${{ secrets.TECH_SERVICES_JIRA_URL }}
JIRA_API_TOKEN: ${{ secrets.TECH_SERVICES_JIRA_TOKEN }}
JIRA_USERNAME: ${{ secrets.TECH_SERVICES_JIRA_EMAIL }}
run: |
echo "No issues found with the 'Dependabot' label in project 'ND'. Creating a new issue..."

create_response=$(curl -s -u $JIRA_USERNAME:$JIRA_API_TOKEN \
-X POST \
-H "Content-Type: application/json" \
--data "{\"fields\":{\"project\":{\"key\":\"ND\"},\"summary\":\"Dependabot PRs for ${{ env.REPO_NAME }}\",\"description\":\"Repository : ${{ env.REPO_NAME }} \\n $PR_DESCRIPTION\",\"issuetype\":{\"name\":\"Story\"},\"labels\":[\"Dependabot\",\"${{ env.REPO_NAME }}\"]}}" \
"$JIRA_URL/rest/api/2/issue")

echo "$create_response"

new_issue_id=$(echo "$create_response" | jq -r '.key')
echo "Created new issue $new_issue_id"
echo "ISSUE_ID=$new_issue_id" >> $GITHUB_ENV

# Step: Update Jira ticket if found
- name: Update Jira ticket
if: (env.ISSUE_COUNT > 0)
id: update-jira-ticket
env:
JIRA_URL: ${{ secrets.TECH_SERVICES_JIRA_URL }}
JIRA_API_TOKEN: ${{ secrets.TECH_SERVICES_JIRA_TOKEN }}
JIRA_USERNAME: ${{ secrets.TECH_SERVICES_JIRA_EMAIL }}
run: |
CURRENT_DATE=$(date '+%Y-%m-%d %H:%M:%S')
echo "Found issue ${{ env.ISSUE_ID }}. Updating the description..."
update_response=$(curl -s -u $JIRA_USERNAME:$JIRA_API_TOKEN \
-X PUT \
-H "Content-Type: application/json" \
--data "{\"fields\":{\"description\":\"Updated on $CURRENT_DATE \n Repository : ${{ env.REPO_NAME }} \n $PR_DESCRIPTION\"}}" \
"$JIRA_URL/rest/api/2/issue/${{ env.ISSUE_ID }}")
echo "Updated issue ${{ env.ISSUE_ID }}"

# Step: Log the issue created or updated
- name: Log created or updated issue
id: log-issue-update
run: |
if [ -n "${{ env.ISSUE_ID }}" ]; then
echo "Issue ${{ env.ISSUE_ID }} was created or updated"
else
echo "Failed to create or update issue"
exit 1
fi

# Step: Comment on all related PRs on GitHub
- name: Comment on GitHub
id: comment-prs
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const prs = JSON.parse(fs.readFileSync('pr_list.json', 'utf8'));

prs.forEach(pr => {
github.rest.issues.createComment({
issue_number: pr.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `${{ env.ISSUE_ID }} created or updated on Jira board`
});
});

# Step: Find transition ID for 'Backlog' in Jira
- name: Find transition ID for Backlog
id: transition-issue
env:
JIRA_URL: ${{ secrets.TECH_SERVICES_JIRA_URL }}
JIRA_API_TOKEN: ${{ secrets.TECH_SERVICES_JIRA_TOKEN }}
JIRA_USERNAME: ${{ secrets.TECH_SERVICES_JIRA_EMAIL }}
run: |
transition_response=$(curl -s -u $JIRA_USERNAME:$JIRA_API_TOKEN \
-X GET \
-H "Content-Type: application/json" \
"$JIRA_URL/rest/api/2/issue/${{ env.ISSUE_ID }}/transitions")
transition_id=$(echo "$transition_response" | jq -r '.transitions[] | select(.name=="Backlog") | .id')
if [ -z "$transition_id" ]; then
echo "Failed to find transition ID for 'Backlog'"
exit 1
fi
echo "TRANSITION_ID=$transition_id" >> $GITHUB_ENV
Loading