Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to enable permissions on moving a JIRA ticket (transitions API) across my team's board?

Austin Serif
October 16, 2023

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:

```

- name: Send HTTP Request
run: |
str="${{ github.event.pull_request.body }} ${{ github.event.pull_request.title}} ${{ steps.get_head_commit_message.outputs.head-commit-message }}"
echo $str

jira_ids=$(echo "$str" | grep -o "[A-Z]*-[0-9]*")
echo $jira_ids

# Convert string of JIRA ids to array
jira_ids_arr=($jira_ids)

staging_deployed="2"
production_deployed="31"


if [[ ${{ github.ref }} == "staging" ]]
then
env=$staging_deployed
elif [[ ${{ github.ref }} == "main" ]]
then
env=$production_deployed
else
env="1"
fi

# Print each JIRA id
for id in "${jira_ids_arr[@]}"; do

curl \
-u ${{ secrets.JIRA_USER_EMAIL }}:${{ secrets.JIRA_API_TOKEN }} \
-X POST \
--data '{"transition":{"id":'$env'}}' \
-H "Content-Type: application/json" \
${{ secrets.JIRA_BASE_URL }}/rest/api/2/issue/$id/transitions
done

```

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.

2 answers

0 votes
Deleted user
October 24, 2018

+1 for this requirement.

The new Roadmap looks brilliant, but it's useless to us until I can view multiple projects, in much the same way that I can use a filter to be the source of a Board and specify the Projects.

Any news on the timing of this?

0 votes
Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
October 22, 2018

Hello,

I believe it is not possible. Epics are chosen only form one project.

Ruth Norton
October 22, 2018

Well, poop, that's not going to be able to replace our current executive roadmap view then.  Where can I suggest this as a feature request?

Kevin Lawrence
October 28, 2018

@Ruth Norton, right! A project-level epic roadmap is very helpful. But I also need a roadmap that shows epic or versions from all projects.

Suggest an answer

Log in or Sign up to answer