One month ago I wrote a Github Actions Workflow that 1. Finds any JIRA issue numbers in a merged pull request, and 2. Uses the JIRA rest API to move those tickets into a target repo/environment (in this case it is Staging and Production).
Here is the API call portion of my script:
```
```
It worked for a week or two, and then seemingly out of nowhere I was presented with the following error:
```
{"errorMessages":["Can't move (SCRUM-27). You might not have permission, or the issue is missing required information. If you keep having this problem, contact your Jira Administrator."],"errors":{}}
```
I've tried:
1. Checking that the target transition ids are correct
2. Updating the API key several times
3. Confirming that my email (Org Admin) and all other keys/secrets are correct and properly stored/declared in github's secrets manager
During the time between when it worked and it started failing, the only change to my JIRA organization (which uses the Free tier) was that I added two new users.
Any help would be greatly appreciated, as it took me a while to get the script working in the first place.
Hello @Austin Serif
Welcome to the Atlassian community.
Have you checked to see if the workflow has been edited or replaced since the last time it ran successfully?
Does the transition include Validators that are blocking the transition? Are there Conditions on the transition that would prevent it from transitioning?
Have you confirmed that the user used by the API can execute the transition manually through the UI?
Hi @Trudy Claspill, thanks for your reply.
1. Unsure of whether or not an accidental workflow update was made previously, I performed modifications to the transitions and retrieved the new transition ids.
2. No rules (including validation rules) are attached to any of the transitions in my workflow.
3. The user whose credentials are passed to the REST API is able to successfully move items across the board as expected, including where transition modifications were made.
4. Lastly I tested the API call both when the target JIRA issue is unassigned and when the issue is assigned to the user whose credentials are used in the API call.
Unfortunately, the same error was produced in each case.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is the target issue in a Team Managed project or a Company Managed project?
How did you verify the transition IDs?
Do you have any logging that tells you what transition ID value is actually getting used in the API call?
What transition has ID = 1; the default you use at the bottom of the IF block?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The transition ids were verified by inspecting the response data returned by my-atlassian-domain.net/gateway/api/jira/project-configuration/query/93c61771-74fd-445f-94d7-e0193277eff8/2/workflow. This call is triggered whenever I enter the edit workflow page.
Using the property path `workflows[0].transitions[6]` I access the following transition data, which refers to the transition from Staging Deployed to Production Deployed statuses:
{
"id": "6",
"type": "DIRECTED",
"from": [
{
"statusReference": "10005",
"port": 3
}
],
"to": {
"statusReference": "10006",
"port": 7
},
"name": "Production Release",
"description": "",
"actions": [],
"validators": [],
"triggers": [],
"properties": {}
}
Similarly, the following transition refers to issues moved from In Progress or In Review to Staging Deployed:
{
"id": "8",
"type": "DIRECTED",
"from": [
{
"statusReference": "10001",
"port": 0
},
{
"statusReference": "10004",
"port": 0
}
],
"to": {
"statusReference": "10005",
"port": 7
},
"name": "Staging Deployed",
"description": "",
"actions": [],
"validators": [],
"triggers": [],
"properties": {}
}
2. Yes, I have logging that confirms the transition ids found above are passed to the API call.
3. transition_id = 1 is the To do column. This was including during earlier debugging and not removed. It should be removed, but according to available logs that transition id has never been set or passed so isn't a huge concern.
4. I will check about team vs company project. It should be a team project since this is a small project run but myself and includes only a handful of other people, not sure how I could have made it a company project accidentally.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It turns out my logs were misplaced and you were right! I was able to resolve it immediately following.. thanks so much!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.