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 Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
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