diff --git a/.github/workflows/Sync GitHub Issues with Jira and Manage Assignees b/.github/workflows/Sync GitHub Issues with Jira and Manage Assignees index 960bf770..8d7d8e38 100644 --- a/.github/workflows/Sync GitHub Issues with Jira and Manage Assignees +++ b/.github/workflows/Sync GitHub Issues with Jira and Manage Assignees @@ -23,6 +23,7 @@ jobs: ISSUE_ASSIGNEE="${{ github.event.issue.assignee.login }}" JIRA_ASSIGNEE_ID=$(curl -s -u $JIRA_EMAIL:$JIRA_API_TOKEN "$JIRA_BASE_URL/rest/api/3/user/search?query=$ISSUE_ASSIGNEE" | jq -r '.[0].accountId') + # Create or update Jira issue if [ "${{ github.event.action }}" == "opened" ]; then RESPONSE=$(curl -s -u $JIRA_EMAIL:$JIRA_API_TOKEN -X POST -H "Content-Type: application/json" \ --data '{ @@ -37,6 +38,7 @@ jobs: echo "Jira API response: $RESPONSE" fi + # Sync assignee if [ "${{ github.event.action }}" == "assigned" ] || [ "${{ github.event.action }}" == "unassigned" ]; then curl -s -u $JIRA_EMAIL:$JIRA_API_TOKEN -X PUT -H "Content-Type: application/json" \ --data '{"update": {"assignee": [{"set": {"accountId": "'$JIRA_ASSIGNEE_ID'"}}]}}' "$JIRA_BASE_URL/rest/api/3/issue/${{ env.JIRA_ISSUE_KEY }}"