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

Restrict Sub-task move to other issue type and based on parent issue type

Lakshmi S
Contributor
January 9, 2025 edited

Hi Team,,

I am working on requirements to restrict subtasks for specific parent issue types. Will these cases fit the scenarios?
I used this behavior to restrict the subtasks to parent tickets. https://library.adaptavist.com/entity/restrict-subtask-options

How to restrict the sub-tasks in the below scenarios.  Do you have any script samples to achieve these requirements?

1. If Parent is issue type "Project" : I shouldn't be allowed to move "Sub-task" issue type to "Connection" sub-task.


2. And moving parent "Opportunity" issue type to "Project" issue type, I should not be allowed if any "Connection" subtasks are created to the Opportunity parent.

2 answers

0 votes
Kawan Diogo
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.
January 24, 2025

Hi @Lakshmi S 

If I understand correctly, what you need is related to the "Move" option, because it allows you to change the issue type, perhaps overriding the behavior set in the Create Screen.

In that case, you can't limit the list of options, but you can hide the "Move" option.

I would only recommend this approach in one specific case: when in both scenarios, the issue type cannot be changed. For example, if you can change the issue type from "Opportunity" to "Discovery" but not to "Project" (as described in the second scenario), then hiding the "Move" option is not a viable solution for you.

 

To know more, you can read this article from scriptrunner talking more about Script Fragments

Lakshmi S
Contributor
January 27, 2025

Ok @Kawan Diogo , Thank you for the explanation. 

0 votes
Derek Fields (RightStar)
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 9, 2025

The library script that you referenced has the basic structure that you want. You will have to modify the specific conditions to meet your use case. 

I am not sure what question you are asking.

Lakshmi S
Contributor
January 23, 2025

Hi @Derek Fields (RightStar) ,

What I am asking is , How to restrict the sub-tasks in the below scenarios using the scripter runner?

1. If Parent is issue type "Project" : I shouldn't be allowed to move "Sub-task" issue type to "Connection" sub-task.


2. And moving parent "Opportunity" issue type to "Project" issue type, I should not be allowed if any "Connection" subtasks are created to the Opportunity parent.

Derek Fields (RightStar)
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 24, 2025

If I understand correctly, you want to limit the options on the Move screen, which I don't think is possible. The script that you shared will work on an Issue Create or Issue Update, but not on Move, which is controlled differently. 

 

Lakshmi S
Contributor
January 27, 2025

Thank you for your response @Derek Fields (RightStar) 

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, team '25, conference, certifications, bootcamps, training experience, anaheim ca,

Want to make the most of Team ‘25?

Spend the day sharpening your skills in Atlassian Cloud Organization Admin or Jira Administration, then take the exam onsite. Already ready? Take one - or more - of 12 different certification exams while you’re in Anaheim at Team' 25.

Learn more
AUG Leaders

Upcoming Jira Events