Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to transition subtask status depending on parent status?

Artur Martins December 23, 2016

 

I have this error on LOG:

"WORK_ON_ISSUES not granted by 'denied' workflow permission
WORK_ON_ISSUES granted by permission scheme but DENIED by workflow"

I remove all of properties but the error remain.

To you understand:

I have 2 workflows (1 workflow for parent and 1 workflow for subtask).

When I create an issue on JIRA, seems like that:

Parent TST-1000 (status: OPEN)
- Subtask TST-1001 (status: OPEN)
- Subtask TST-1002 (status: OPEN)


I would like to configure that subtasks can only have the button START if the PARENT be on status: IN PROGRESS.

I have 3 conditions on transition START:

1) Only the assignee of the issue can execute this transition.
2) Only users with Assignable User permission can execute this transition.
3) ScriptRunner workflow function - Custom script condition (inline script). issue.getStatus () == "In Progress"

If I choose "All of the following conditions", the button appears, but does not matter if the PARENT issue is on "OPEN" or "IN PROGRESS" status (so that is not working for me), and if I choose "Any of the following conditions", the button disappear.
I'm using JIRA 7.2 and scriptrunner 4.3.15, I don't know if the error is caused by JIRA or Scriptrunner.

Capture1.GIF

Capture_subtask.GIF

Capture_transition.GIF

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

3 votes
Answer accepted
Jonny Carter
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 Leaders.
December 23, 2016

Your condition will check the subtask's status, not the parent issue. Instead of

issue.getStatus () == "In Progress"

Try

issue.parentObject?.status?.name == "In Progress" || !issue.parentObject

The second part of the condition will return true if the issue in question is not a sub-task.

Artur Martins December 23, 2016

I changed the script, but I still have the same problem.

On JIRA log: "WORK_ON_ISSUES not granted by 'denied' workflow permission
WORK_ON_ISSUES granted by permission scheme but DENIED by workflow"

 

I changed my permission scheme to "any logged user" and the transition "Start" is not appearing.

Jonny Carter
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 Leaders.
December 23, 2016

This is likely not due to your ScriptRunner conditions, but due to your permissions scheme on the workflow transition. See https://confluence.atlassian.com/jirakb/workflow-step-properties-blocks-transition-actions-744527384.html

Artur Martins December 23, 2016

I saw this link and I did a test now using a new workflow without the properties.

I have the error too.

Artur Martins December 23, 2016

I just want to block the transition of the sub task "Start" when my parent issue is on "OPEN"

Jonny Carter
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 Leaders.
December 23, 2016

Actually, there was a bug in my original answer. I fixed it now; I was getting the status object, but not the name property.

If you want to block the transition when the issue is open (rather than allow it when the issue is In Progress), try

issue.parentObject?.status?.name != "Open" || !issue.parentObject

If that still doesn't work, can you post screenshots of your Workflow Step Properties, along with the latest condition script you're using?

Artur Martins December 23, 2016

It worked now!

It seems that Santa came earlier!

 

Thank yoouuuu!

0 votes
Ramaiah Pendli June 19, 2018

@Jonny Carter

where i need to apply below condition script, is it parent or sub-task workflow transition.

issue.parentObject?.status?.name != "Open" || !issue.parentObjects 

 

TAGS
AUG Leaders

Atlassian Community Events