Forums

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

How can I add a "Create SubTask" button on a view issue screen?

NTT Europe March 25, 2014

I am looking for a way to add a button to the view issue screen that opens the create subtask widget.

Is there any simple way?

Many thanks

2 answers

1 vote
Puján Z
Contributor
July 18, 2019

Hi,

You can use Adaptivist ScriptRunner plugin to create a Script Field (HTML) that creates a button with /jira/secure/CreateSubTaskIssue!default.jspa?parentIssueId=$parentIssueId

Then add it to the view screen of your (parent) issue. :) Here is an example, if a contact person issue type was of a sub-task type:

def baseurl = com.atlassian.jira.component.ComponentAccessor.getApplicationProperties().getString("jira.baseurl")

String contactPersonIssueTypeId = "11002" //Contact Person
def subtaskCreationUrl = baseurl+"/secure/CreateSubTaskIssue!default.jspa?parentIssueId="+issue.getId()+"&issuetype="+contactPersonIssueTypeId
String createSubtaskLinkLabel = "Add contact person"
String createSubtaskLinkTitle = "Add a new Contact Person for this issue"

def completeLink = "<a id='create_link' class='aui-button aui-button-primary aui-style custom-create-link' title='"+createSubtaskLinkTitle+"' href='"+subtaskCreationUrl+"'>"+createSubtaskLinkLabel+"</a>"
return completeLink

Gábor Budai October 19, 2021

@Puján Z this works like charm, thanks :) 

0 votes
Marten Kreienbrock
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.
March 26, 2014

If you create a button which calls /jira/secure/CreateSubTaskIssue!default.jspa?parentIssueId=>Your parent Issue<, the create dialog should open

NTT Europe April 13, 2014

Hi,

Indeed, the link is perfect, but I am wondering how to add a button.

Many thanks!

Marten Kreienbrock
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.
April 13, 2014

In this case i'm not sure about any easier ways, but you could create a Web Panel Plugin Module with the location set to "atl.jira.view.issue.left.context". This would provide you with a new panel in the issue details view, which you could either use as location for your button or as a way of injecting some Javascript, which could place a button somewhere next to the other buttons in the upper area of the page.

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, jira service management, jsm webinar, ai in jsm, opsgenie integration, incident management, virtual agent, atlassian intelligence, ai-powered service desk, it operations, atlassian learning, service management webinar, team '25 recap

What’s new in Jira Service Management 🤔

Discover how Atlassian is revolutionizing service management with cutting-edge solutions for AI-powered support, HR Service Management, or DevOps connectivity.

Register here ⬇️
AUG Leaders

Atlassian Community Events