JIRA Create Issue dialog - preselect pid & issueType

Andrei [errno]
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 3, 2013

I would like to construct a URL that if clicked lands me on:

I know how to pre-select the Project ID (selectedProjectId=10603):

http://jira.example.com/secure/CreateIssue!default.jspa?selectedProjectId=10603

what parameter should I use to pre-select the issueType ID along with PID?

5 answers

1 accepted

6 votes
Answer accepted
Andrei [errno]
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 4, 2013

the correct URL for the above screenshot:

http://jira.example.com/secure/CreateIssue!default.jspa?selectedProjectId=10603&issuetype=3

pelizza
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.
November 10, 2014

That does the trick! There is some way of getting the just created issue's id?

Like # people like this
RVal
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 5, 2016

Had to replace selectedProjectId= with pid= in JIRA 6.4.9

http://jira.example.com/secure/CreateIssue.jspa?pid=10603&issuetype=3

 

pelizza
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 5, 2016

Recently, I've found another way to open the create issue/subtask dialog. Here it is:

// Create Subtask
JIRA.Forms
  .createSubtaskForm({parentIssueId: 10110})
  .asDialog({windowTitle: 'Create Subtask'})
  .show();
 
// Create Issue
JIRA.Forms
  .createCreateIssueForm({pid: 10000})
  .asDialog({windowTitle: 'Create Issue'})
  .show();

Now I don't have to create hidden links to open them anymore.

Like # people like this
Brahim ESSALIH October 20, 2016

How I can set the parent iD in as a parameter URL? 

I tried http://jira.example.com/secure/CreateIssue.jspa?pid=10603&issuetype=3&parentId=123

But it dosn't work

 

Vitor Pelizza October 20, 2016

I don't believe this is possible. You have to open it using javascript.

Oliver Eckle February 10, 2019

Is using JIRA.Forms still up to date or should i use AJS.Dialog instead? or is that something different?

Dimitris Ballas October 10, 2019

using parentId makes sense when you are creating subtasks via html links. And the correct syntax would be as per below:

<jira_base_URL>/secure/CreateSubTaskIssue.jspa?pid=10200&parentIssueId=10201&summary=subtask+created+via+link

1 vote
Henning Tietgens
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 4, 2013

If found something even better :-) You can use this

&lt;div id="create-issue"&gt;
&lt;a href="/secure/CreateIssue.jspa?pid=10603&amp;amp;issuetype=15" class="create-issue-type" data-pid="10603" data-issue-type="15"&gt;create issue&lt;/a&gt;
&lt;/div&gt;

to open a popup Create Issue screen if your JIRA version supports this. The data-... parameter must match the ids of the link (in fact, the link isn't even used if the popup could be opened).

Because of the needed surrounding element with id "create-issue" there will be some CSS formating applied to the link, which maybe you want to manually remove by applying some style parameter.

Henning

Henning Tietgens
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 4, 2013

Ok, this is not a simple URL.... I use this to display a "support" link on every page through the announcment banner and want to share it :-)

Gopi krishna August 26, 2013

Hi Hennings,

How will we get the defect id that is created? or How the parent page will get the Defect id that is created using direct html Link?

Henning Tietgens
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.
August 26, 2013

Hi Gopi,

I'm sorry but I don't know how to get the issue key of the created issue. Maybe you should ask this as a separate question.

Henning

LukasG May 19, 2015

any chance to pass a parameter for a custom field so it will be pre-filled with the passed value?

Like Anthony Sylvester likes this
pelizza
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.
May 19, 2015

I just found this link: https://confluence.atlassian.com/display/JIRAKB/Creating+Issues+via+direct+HTML+links In spite of this, I was not able to do this some months ago and there is an open issue on Atlassian's ecosystem, with lots of votes, asking for this feature.

LukasG May 19, 2015

thanks. the problem with this is that when you use CreateIssueDetail.jspa and provide the parameters, the system immediatly triggers validation and you end up with an error message. in my case I want to pre-populate some fields and other (mandatory) fields should stay blank.

pelizza
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.
May 20, 2015

You got it! That was the problem when I was trying to do the same thing. So, I really don't believe this is possible. I can't find the open issue that I told you :(

Linus Lindroth May 21, 2015

I don't know but perhaps the usage of os_destination can solve the problem? See another case at https://answers.atlassian.com/questions/12912148/using-direct-url-without-getting-error-message

1 vote
Henning Tietgens
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 3, 2013

You can look on the project page. On the summary page there are buttons for the first issue types with the correct links for it. E.g. you have to use http://jira.example.com/secure/CreateIssue.jspa?pid=10150&issuetype=40.

Henning

Andrei [errno]
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 3, 2013

oh, right... thanks! - how could I forget that?

this works, although I am still curious if there is a way to preselect both PID and IssueType for the view in my screenshot

Linus Lindroth February 27, 2015

Hi, is there a way of not getting the huge ERROR sign saying: "You are not logged in, and do not have the permissions required to create an issue in this project as a guest. To create an issue first log in" That is quite annoying for a user that has never used JIRA before. Does not look very professional. I would like to get to the login screen immediately.

Divya Yathagiri Venkata September 10, 2018

Yes, you need to login to JIRA before you access the create links or you can login directly from the create link. This is because JIRA needs to authorise that you are JIRA user before you can create a JIRA issue.

0 votes
Christian Sprenger May 27, 2019

I can not create the link without issuetype

{quote}

https://ptticket.global.schindler.com/secure/CreateIssueDetails!init.jspa?pid=11101&issuetype=10607&priority=3

{quote}

works, but 

{quote}

https://ptticket.global.schindler.com/secure/CreateIssueDetails!init.jspa?pid=11101&priority=3

{quote}

does not work. I can not choose an issue type, it will say "No issue type selected".

So you have to have a minimum and can not combine as you like.
Same/similar btw for priority. If I remove that part it chooses Critical, which, for this project, is not available.

0 votes
Andrei [errno]
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 3, 2013

I am aware of https://confluence.atlassian.com/display/JIRA/Creating+Issues+via+direct+HTML+links - but this assumes I know about reporter/summary - and throws error msgs if used with just pid and issueType.

http://jira.example.com/secure/CreateIssueDetails!init.jspa?pid=10603&issuetype=15

Suggest an answer

Log in or Sign up to answer