Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to hide transition from parent issue (Always status will update automatically from sub-tasks)

We want to hide transition's from parent issue and we have A script that will update the status of parent issue automatically when sub-tasks is hiding .

 

I have tried some default conditions to particular admin group to transition on parent issue  but that post-function script in sub-task is  failing to transition automatically.

 

Could anyone help us to achieve this task

2 answers

Hi,

Supposing your parent issue needs to change from status "A" to status "B" when the subtask changes to "hidden" status, you can try a rule :

In your project parameters -> project automation -> project rules, and then :

   - WHEN : demand transition
   - IF : JQL query corresponds to (for example issueType = "subtask")
   - RELATED REQUEST : parent (select your link type)
          ° IF : JQL condition (for example status != "B")
          ° AND : condition of related requests (status = "hidden"
          ° SO : transition to the correct status

Note that " - " is for the master branch, and " ° " for the secondary branch

Regards

@Anne Morel 

 

I appreciate your response we need to hide transition that any one can't able to transition from parent issue status will be updated based on sub task status.

0 votes
Antoine Berry Community Leader Jan 31, 2020

Hi @Mahesh Kallepalli ,

I did not exactly understand what you want to achieve, but you can use this code to transition the parent issue from the subtask :

import com.atlassian.jira.workflow.WorkflowTransitionUtil
import com.atlassian.jira.workflow.WorkflowTransitionUtilImpl
import com.atlassian.jira.util.JiraUtils

def parentIssue = issue.getParentObject()
def userKey = "user_that_triggers_the_transition"
def transitionId = 41

WorkflowTransitionUtil workflowTransitionUtil = ( WorkflowTransitionUtil ) JiraUtils.loadComponent( WorkflowTransitionUtilImpl.class );
workflowTransitionUtil.setIssue(parentIssue);
workflowTransitionUtil.setUserkey(userKey)


workflowTransitionUtil.setAction(transitionId);
workflowTransitionUtil.progress();

@Antoine Berry 

 

I have achieved that when sub task is transitioned parent issue status is changing every time transitions will happen from sub task only we don't want to allow any user or agent to transition from main task so we are thinking to hide the transitions from parent task.

Antoine Berry Community Leader Feb 03, 2020

You could use a validator in the parent workflow transition (the users will still see the button, but will get an error message if they click it) : 

import com.opensymphony.workflow.InvalidInputException

InvalidInputException userErrorMsg= new InvalidInputException()
String errorMsg = "You cannot trigger this transition on the parent issue."
throw userErrorMsg

Let me know if that helped. 

Dear Antoine,

 

I tried to put this validator in the Parent Workflow transition and I have a Post Function in the SubTask to transition that Parent transition.

But I'm getting the error when transition the SubTask.

 

 

org.ofbiz.core.entity.GenericTransactionException: Commit failed, rollback previously requested by nested transaction.

It seems that you have tried to perform an illegal workflow operation.

If you think this message is wrong, please contact your JIRA administrators.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Marketplace Apps & Integrations

New cloud apps roundup - June 2021

Since our last roundup in April, Atlassian's Marketplace Partners have added over 100 new cloud apps to the Atlassian Marketplace to help your teams work more efficiently. Let’s take a quick look a...

491 views 6 12
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you