Trying to write a SIL script for Create Sub-task screen that looks at Parent issueType


I am trying to address a gap in the Jira architecture in that you cannot restrict sub-tasks given a parent issue type. See this very old request here -

I am attemptoing to use JJUPIN Live Fields to accomplish this. We have used this to restrict issue types based on things like group membership or resolution (like here - So my basic logic is as follows...identify the parent tasks that should not allow sub-tasks, identify the sub-task types to restrict and then if the parent task used should be restricted, do so via live fields function.

// array of parent issue types that should not allow subtasks

string[] standAloneParentTypes = {"Idea", "Bug", "User Access Request"};

// array of the sub-task issue types to restrict

string[] forbiddenTypes = {"UX Design Sub-task", "QA Sub-task", "Tech Design Sub-task"};

// If the parent issue type is one that cannot have sub-tasks, restrict options to not include them

if (arrayFind(standAloneParentTypes, issueType) != -1) {

    lfRestrictSelectOptions("issueType", forbiddenTypes);


This does not seem to work. I am pretty sure that I am not reading the issueType of the parent task from which a subtask is being created. Anyone know how I would go about doing this? I have an idea of adding a custom field like allowsSubtasks and set that post creation and then use it in this same scenario if I cannot get this to work.

1 answer

Hi Joe,

Your syntax is worng. You should use parent.issueType instead of "<strong>issueType</strong>" in your if clause, like this:

if (arrayFind(standAloneParentTypes, parent.issueType) != -1) {
lfRestrictSelectOptions("issueType", forbiddenTypes);
This will work on inline edit, normal edit and transition screen.
However, on the create issue screen we don't have access to the parent variable, so you should try to restrict the sub-tasks issue types using a SIL validator on the Create Issue tranistion.
Here's an example of a SIL Validator based on the parent's status:
You SIL validator script would be:
if (arrayFind(standAloneParentTypes, parent.issueType) != -1 && arrayFind(forbiddenTypes, issueType) != -1) {
return false, "issueType", "You cannot select issue type '" + issueType + "'";
Hope this helps.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Jan 08, 2019 in Jira

How to Jira for designers

I’m a designer on the Jira team. For a long time, I’ve fielded questions from other designers about how they should be using Jira Software with their design team. I’ve also heard feedback from other ...

1,098 views 4 9
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you