How to suspend/hide the description in the parent/main ticket in Jira, but not in its Sub-task

Sonia February 25, 2025

The issue called "Onboarding" of a project will automatically create a Sub-task (using post functions at transition:create.  We need to put some instructions in the Description field for users to complete the Sub-task.  The content of the description is setup in the Behavior in ScriptRunner. 

Syntax:
===================================

  //  getFieldByName('Description').setHidden(true)   // This line does not work
 //   field.setFieldOptions(['Sub-task'])  //only Subtask is allowed but nothing shows up.
//-------------------------------------------------------------------------------------------------------
def field = getFieldByName('Description')
def defaultValue = """\
      *When onboarding with BSF and setting up its pipeline feature and other capabilities, completing the checklist steps in this Jira ticket should help you through the process.*
     ... etc.
""".stripIndent()
=====================================

The content pops up OK in both the parent "Onboarding" and Sub-Task.
Since it is a duplicate content, and I try to omit/hide the description in the main ticket, but there is no way to make it work.  I also try to use new custom field "Onboard Description" for Sub-Task and remove "Description" from the main ticket. The result is no content/blank  for both main and sub-task.
  Please advise how to proceed this?
   Thank you!
   Cathy

1 answer

1 accepted

1 vote
Answer accepted
Digvijay Singh February 26, 2025

Hi @soni 

If you wish to use scriptrunner post-function on Create Transition on Parent Workflow

then you can use "Create a sub-task" post-function.

Select Target Issue Type as <your-sub-task-type>

Fields to copy: Custom > Description (System field)

Additional Issue actions: 

issue.description = '<your-description-verbiage-for-sub-task-only>'

So, whenever a Parent issue is created then the Sub-task will also create with your set description and it will only appear on Sub-task and not on Parent/Main issue.

I hope this helps.

Thanks,

Digvijay

Sonia February 26, 2025

Hi Digvijay,

    Thanks so much for your suggestion and help!

    It works now!  

    Thanks again,

     Sonia

Like Digvijay Singh likes this
Sonia February 27, 2025

Hi Digvijay,

    After changing this configuration, the pre-set in ScriptRunner Behavior for "High" priority for Sub-Task is no longer working, and only the main ticket "Onboarding" works.  

The Script Runner behavior set the mapping to the project for both main and Sub-task issue types. The code is:

// set a priority value for both Onboarding and Sub-task

def field = getFieldByName('Priority')
field.setFormValue('High')
Do you know why and how to fix Sub-task priority?
Thanks a lot,
Sonia

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
9.12
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events