Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

I want to create a custom button to create a subtask under different link type

Arunajyothi Samala July 11, 2024

 

Hello, Need help

 

I have a request where customer wants a custom button named Create AC. when user clicks on it, it should t open create subtask issue dialog box and let the user create a subtask under a link type called "Acceptance criteria" and this button should be only available to feature issue type.

 

So far I used the xml raw script fragment from ScriptRunner to have a custom web item called create Acceptance Criteria and link it as a subtask. 


below is the script to  restrict the web item only to feature  : 

 

<web-item key='issuekey-123' name='ScriptRunner generated web item - Create Acceptance criteria' section='operations-restore' weight='1'>
    <label>Add Acceptance Criteria</label>
    <link linkId='link-create-constrained-subtask'>/jira/secure/CreateSubTaskIssue.jspa?parentIssueId=${issue.id}&amp;pid=${issue.projectObject.id}&amp;issuetype=14901</link>
    <styleClass>issueaction-create-subtask</styleClass>
    <param name="condition">issue.issueType.name == 'Feature' || issue.issueType.name == 'Epic'</param>
</web-item>

 

 

 

working script for a button to create subtask: 

 

<web-item key='issuekey-123' name='ScriptRunner generated web item - Create Acceptance criteria' section='operations-restore' weight='1'>

    <label>Add Acceptance Criteria</label>

    <link linkId='link-create-constrained-subtask'>/jira/secure/CreateSubTaskIssue.jspa?parentIssueId=${issue.id}&amp;pid=${issue.projectObject.id}&amp;issuetype=14901</link>

    <styleClass>issueaction-create-subtask</styleClass>

</web-item>

1 answer

0 votes
Ram Kumar Aravindakshan _Adaptavist_
Community Champion
January 15, 2025

Hi @Arunajyothi Samala

Were you able to find a solution for this?

Thank you and Kind regards,
Ram

Arunajyothi Samala January 15, 2025

Yes, I used the ScriptRunner Fragment called Constrained issue web item custom button and behaviour script. 

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, likes for trees, atlassian community, social impact, tree planting campaign, community kudos, atlassian giving, environmental impact, sustainability, likes for good, atlassian social responsibility, community challenge

Make every click count—help us plant 50,000 trees! 🌳

Want to make your everyday Community actions directly contribute to reforestation? The Atlassian Community can achieve this goal by liking a post, attending an ACE, sending your peers kudos, and so much more!

Help us plant more trees
AUG Leaders

Atlassian Community Events