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

Need to show a transition screen for Sub-task based upon parent issue type

Krishnakumar Parameswaran September 25, 2018

I'm looking to show a transition screen when a sub task is transitioned from x to y based upon parent issue type.

The requirements are :

  1. its should show/hide the fields on the screen based upon the parent issue type.
  2. its should set the fields required / optional on the screen based upon the parent issue type.
  3. the screen should show the parent issue type value.
  4. Looking for Behavior / script runner scripts.

 

 

1 answer

Suggest an answer

Log in or Sign up to answer
3 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 25, 2018

You can't do this directly.  Behaviours can do the show/hide, and require/optional, but the choice of whether to show a screen is out of your control, as is the display of parent issue.

But you can do those indirectly:

  • Create a scripted field for "parent issue type" and use that on the screen
  • In the workflow, have two transitions
    • One with a screen, one without
    • Have a condition on both transitions that looks at the parent issue type and blocks the transition or allows it depending on type
Vinoth V September 26, 2018

Hi Nic,

Thanks for your reply.

We basically wanted to show the transition screen always for all sub-task transitions. We need to show fields in the transition screen based on the parent issue type. Thoughts ?

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 26, 2018

Ok, it's the same answer, but change "without a screen" to "with a different screen"

Krishnakumar Parameswaran September 26, 2018

@Nic Brough -Adaptavist- ,

I've used below code in behavior for all sub-task transitions.

 

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.*

def parentIssueType = getFieldById("Parent Issue Type")?.formValue
def fieldToHideA = getFieldByName("Target Release")
def fieldToRequireB = getFieldByName("Target Release")

if ( parentIssueType=="Bug Sub-task" && issueContext.issueType.name == "Sub-task" )
{

fieldToHideA.setHidden(true)

fieldToRequireB.setRequired(true)

}

 

the compiles without any error.

while the transition happening i'm not able to get the result as expected.

TAGS
AUG Leaders

Atlassian Community Events