Search the JIRA 5.0.x Beta and RCs Documentation:

Index
Downloads (PDF, HTML & XML formats)
Other versions

This documentation relates to JIRA 5.0.x Beta and RCs only.
The latest official version is JIRA 4.4.x
If you are using JIRA 4.4.x either view this page in the JIRA 4.4.x documentation or visit the JIRA 4.4.x documentation home page.
Skip to end of metadata
Go to start of metadata

(warning) Please Note: JIRA 4.1+ now uses form tokens as an additional level of security against cross-site request forgery. See Form Token Handling for details on how your external HTML form will handle form tokens.

If you would like your users to create issues from another site, you can by putting links to your JIRA's create issue page. You can also populate the fields on the page with values to select the project, the issue type or even the summary of the issue. This document will detail how to construct theses links and how to populate the fields. This feature is available from JIRA 3.5 onwards.

The minimal HTML link to create issues has the following structure:

where

Component

Description

Example

[JIRA BASE URL]

 The Base URL of the JIRA you wish to create issues in

http://jira.atlassian.com

[ARGUMENTS]

 List of key value pairs separated by '&' which represent the field and its value to be set in the create issue screen

pid=10420&issuetype=4

[DESCRIPTION]

 The link description visible to users

create issue in Test Project

This Base URL is the same as the JIRA Base URL you wish to create issues in. This can be found under the admin section -> General Configuration -> Settings. For example, http://jira.atlassian.com is the base URL of the JIRA running at Atlassian.

The list of key value pairs included define which fields will have what values set. The argument list has the following properties:

  • Each key value pair is separated by an '&'
    • For Example: [keyValuePair]&[keyValuePair]&[keyValuePair]...
  • Each key value pair has the form 'key=value' where key is a field name and the value is the desired value to be set for its corresponding field
    • For Example: 'pid=10420&issuetype=1&summary=helloWorld&description=greetings'...
  • The list must comply with HTML link syntax - that is all characters must be escaped.
    • Characters like space cannot be used directly, they must be encoded (escaped). Hence to use a space, we would replace the space with a '+' or '%20' which is the space equivalent. An excellent HTML URL-encoding reference listing all the characters and their corresponding encoded symbol can be found here
    • For Example: 'summary=This+is+a+summary%20with%20escaped+spaces'

As you can see, constructing the argument list is relatively simple. All we need is the name of the fields we want to set values for, and just structure it as above.

Fields thats not set will simply be assigned their normal default values. And the issue is not created until the user submits the form (this includes a validation check to confirm the field values are correct).

The key in the key-value pair is the fields name, and to set a value for that field, we first need to know its name. The name of the field can be found by examining the source code of the page in which the field is in (To view the source code of a page, right click on the browser and select 'View source' or alike). Each field has a name attribute which represents the fields name. So all you need to do is find that attribute.

To find the possible values you can set is a bit more tricky. For any fields which accept plain text (such as summary, description and environment) there are no restrictions. However for other fields (such as Project, Issue Type, etc which take in Id) will require you to find the Id values. The range of Id values you can set can be found examining the same source code you found the field name from.

For example, the following is the HTML source code from the create issue page. From this we know that the Components field has the key 'components' with values '10013', '10014' and '10015' for each of the 3 components.

The following table shows a sample list of the standard JIRA fields with their name (key), the type of value expected and an example of the value

Display Name

Key

Value Type

Value Examples

Project

pid

Project Id

' 10420'

Issue Type

issuetype

Issue Type Id

standard JIRA issue type values range from '1' to '4'

Summary

summary

Plain Text

'issue+created%20via+link'

Priority

priority

Priority Id

standard JIRA priority values range from '1' to '5'

Due Date

duedate

Date

'15-Dec-2005' - may have different format depending on your JIRA date settings

Components

components

Component Id

'10014'

Affects Version/s

versions

Version Id

'10015'

Fix Version/s:

fixVersions

Version Id

'10015'

Assign To

assignee

Username

'admin' or 'sam@atlassian.com'

Reporter

reporter

Username

'admin' or 'sam@atlassian.com'
To have the reporter field default to the currently logged in user, the user must be logged in and must not have the Modify Reporter permission.

Environment

environment

Plain Text

'this+is+the+environment'

Description

description

Plain Text

'this+is+the+description'

Custom Fields

Custom Fields key and value can be found by examining the source code also. There name/key are prefixed by 'customfield_' followed by their custom field id. For Example: 'customfield_10000'

Here are some simple examples to help you on your way. These examples provide links to create issue in JIRA Atlassian Test Project.

Source Code 

Output

To create an improvement issue in the Test project, click here

To create a task with summary 'say hello world', click here

To create a task with multiple values selected for a field, click here

   A more detailed example to
   <a href="http://jira.atlassian.com/secure/CreateIssueDetails!init.jspa?pid=10420&issuetype=2&summary=detailed+example
   &description=description+goes+here&components=10240&duedate=7%2dDec%2d2005
   &customfield_10010=this+is+a+custom+field">
   create an issue.</a> Has description, components, due date and a custom field preset.

A more detailed example to create an issue. Has description, components, due date and a custom field preset.

Labels:
  1. Aug 10, 2006

    Thanks for providing this .. one question, though. I want to use this for a helpdesk application so users can click a link to "get started", but unless I put something in the summary, it complains that it is a required field - like it's trying to submit the issue right away, before the user has pressed Create. Is there a way to stop that?

    1. Aug 11, 2006

      Hello Neal,

      I don't think there is a way to suppress it at the moment as it is a natural behaviour of JIRA/WebWork. Perhaps, you can try raising an improvement issue and we will see how the developers will respond to it.

      Cheers,
      Yuen-Chi

  2. Aug 11, 2006

    I got around the problem by doing this:

    CreateIssueDetails!init.jspa?pid=10110&issuetype=6&priority=1&summary=Emergency

    for the link I want to pass the priority with, and

    CreateIssue.jspa?pid=10110&issuetype=1

    for the rest

  3. Oct 17, 2006

    does this require that the permission to create issues in the project in question is set to 'Anyone' ?

    1. Oct 17, 2006

      Most definitely not.. I don't have such a permission on any project.

    2. Oct 19, 2006

      Hi Amrit,

      It's not necessary to set the Permission to create issues to Anyone. It really depends on which user/group you wish to grant the access to create issues to. As long as the user has the permission to create issues, then he/she should be able to create issues via direct HTML links.

      Regards,
      Mei

  4. May 26, 2007

    Hello all,

    Is it some how possible to use custom issue types when creating a new issue? It seems like the issue type is really restricted to allow only numbers from 1 to 4. In our case it should be possible to use numbers 5, 6 and 7 also.

    So, is there any way to get around this problem? This is a really important thing for out customer support -project. 

    1. May 26, 2007

      Have you tried it? It works just dandy for me. I have issuetype=6 in my URL. The documentation (above) simply states the known standard types (and priorities), but doesn't exclude you putting in the ID's of your custom ones.

      1. May 26, 2007

        Thank you Neal for very fast answer!

        My bad. This was an issue type screen scheme problem. Because there was not Component-field in this one specific screen it was impossible to set it via hyperlink. The problem is that this Component-field cannot be shown to users (it has sensitive infomation in options). On the other hand; we are using security levels with all issues which are equal to components.

        Because security level-field can be restricted by permissions from screens, we are now setting security level in the hyperlink instead of a component.

        Sorry for the confusion!

        1. May 26, 2007

          we are now setting security level in the hyperlink instead of a component

          Ouch, couldn't that be a problem? What if a user changed the URL to a different security ID? I guess all they could do is create an issue that they couldn't potentially see ... I was thinking, you could also generate a not-so-obvious URL (generate one at tinyurl.com), but once pressed, the URL would still contain the information. Still, it does obscure the URL until it's clicked.

          1. May 26, 2007

            Good point, but this link is generated in a portlet which is only allowed to use by our support-group; thus it shouldn't be a problem. It has the same basic idea as the Quick Create User Issue -portlet in JIRA Toolkit, but heavily customized.

            The Tinyurl-tip is very usable if we decide to use hyperlink-shortcuts in the front page of our JIRA-installation. Thank you for pointing this out!

  5. Oct 02, 2007

    The link form below opens the standard create issue screen with the designated project preselected, and with no selection error indicator.

    http://jira.site.address/secure/CreateIssue!default.jspa?selectedProjectId=10101
    
    1. Jan 29, 2009

      Anonymous

      Thank you very much for this link. I kept using the link with the variable pid rather than selectedProjectId and was having problems with my users creating issues in the wrong field. The only time pid works is only if you are already logged in and are browsing projects.

      As soon as I changed my link to use selectedProjectID my hyperlinks work everytime from external web sources.

      Thanks again!

  6. Oct 15, 2007

    Hi everybody...!!

     I have a question about the documentation exposed here. When, in my "atlassian-plugin.xml" I put:

    <resource type="velocity" name="view">

                <img src="$req.contextPath/images/icons/bullet_red.gif" height=8 width=8 border=0 align=absmiddle>
     

                <b><a href="/secure/CreateIssue.jspa?pid=10043&issuetype=9">Plugin Issue 1</a></b> issue summary   

    </resource>

    I found an error message, but if I remove "pid=......" or "issuetype=....", and I only put one of these options, it works ok.!. So, can someone tell me what is the problem ??? :S.

    Thanks for all, and sorry for my poor english!!!!

    Cheers, Ricardo.-!

  7. Oct 15, 2007

    It's ok, i've resolved the incident. It's simple, you only have to put " &_amp; "(without "_" ), not only "&". Now it works. But I have another question. If I wan to take a parameter from the page where I am, how can I do That, for example: I'm in the page "details of the incidence", and I want to take in my ".xml" the 'ID' of the project of that incidence, to create another incidence, passing that parameter. How can I know the name of that argument ?.

     Tanks a lot.!

    Ricardo.-!

    1. Oct 29, 2007

      Hi, I have another question now.

       At the first, the

      ".....  customfield_10100=${....} ..."
      

      didn't work, but now it works. It seems like it only works if the destiny field (of issue creation 2/2) is empty. If the destiny field is full of info (that field is full of info by default), the code before don't work... Is it correct ???..... I only can populate/clone the info of customfields if the destiny is empty...
      I need help please, if somebody knows how to force the write of that info or another way to solve that.
      Thanks a lot.!

      Ricardo.-!

  8. Apr 09, 2008

    I'm embedding an issue creation link in a Confluence page, it works fine (prompt for login etc), however I would like to user the logged in ID of the Confluence user to be fed into the reporter field of the issue. I have Jira-Confluence trust setup and working, but not sure in this non-portlet incantation! Is this possible?

    1. Jul 11, 2008

      Yes, we created a user macro with has body - unprocessed macro body and generates wiki markup:

      ## Get current user's user name
      #set ($user=$action.remoteUser)
      #set ($username = $user.name)
      
      ## create issue stuff
      #set ($createString = "http://jira/secure/CreateIssueDetails!init.jspa?pid=10092&issuetype=9&assignee=somebody&reporter=$username&priority=3&components=10130&fixVersions=10133")
      #set ($body="[Create project issue|$createString]")
      
      $body
      

      Another alternative is to use the Run plugin to fill in the current user and/or some of the other parameters.

  9. Jul 11, 2008

    Is it possible to do a similar thing with the "Link to this issue" page URL:

    e.g. http://myjira.com/secure/LinkExistingIssue\!default.jspa?id=12345

    Will this page accept any parameters similar to the above (other than the source issue)?

  10. Sep 09, 2008

    2t

    Hi,
     
    We have a project that converts Lotus Notes to Wiki Jira. A POC we have is to create Minutes using both Wiki and Jira. Wiki for other contents and Jira for Action and Decision items.
    From Wiki we created a button that will automatically go to our Jira - Create New Issue, with a preselected Jira Project Id and Issue Type, so that when the Wiki user clicked on the Button it shows Jira>Create New Issue Step2.  We accomplished this by viewing the Jira source to get the PID (porject id).
     
    The thing is we would like to implement this to all Jira projects. It is quite discouraging for our users who are also new to Wiki/Jira to get the project id just to use and let their tickets show up in Wiki
    Currently we've set only 1 project and used a javascript

    http://jiratst.lawson.com/secure/CreateIssueDetails!init.jspa?pid=10410&issuetype=3";

    Is there a better way to dynamically changed the PID and issuetype above?

    Is there a better way to do this?  Pls advice!
     
    Thanks in advance!
    toti

    1. Dec 09, 2008

      An alternative is to use MailFormNg and email issues into Jira, perhaps by using Jira Extendable Mail Handler to process the mails and actually create issues. The benefit is that for all intents, users stay in Confluence. You can minimize maintenance and overhead by using just one Virtual Mailbox, details for the configuration of which are on the JEMH pages.

      Here is what an example mail form looks like:

  11. Dec 09, 2008

    Andy's suggestion is a good one and we use it. An alternative is to redirect the user to the JIRA creation screen filled with a few parameters based on some initial choices.

    {run:replace=Project:Experiment,Issuetype:Task,Assignee:$current_user_id,Reporter:$current_user_id|autorun=false|titleRun=Create issue}
    
    {sql-query:datasource=jiraDS|output=wiki|table=false}
    select '{redirect:location=http://jira/secure/CreateIssueDetails!init.jspa?pid=' || p.id || '&issuetype=' || it.id || '&assignee=' || '$Assignee' || '&reporter=' || '$Reporter}' from project as p, issuetype as it where lower(p.pname) = lower('$Project') and lower(it.pname) = lower('$Issuetype')
    {sql-query}
    
    {run} 
    
    1. Dec 09, 2008

      +1 for inginuity (smile)

  12. Mar 27, 2009

    Anonymous

    Has anyone been able to get a cascading select field populated via URL?  I can't figure it out - Any examples much appreciated - Thanks.

    1. May 17, 2009

      Yes, it is possible to populate cascading select. Please analyse the HTML code for that parameter. From there you can see that you need to create a URL like:

      http://.../CreateIssueDetails.jspa?os_username=...&customfield_10000=10001&customfield_10000:1=10005
      

      You will need to check the custom field ids and its values.

  13. Sep 16, 2009

    Is it possible to create a link without the project id (pid)?  I wanted Jira to prompt for project and type the same way it does when you create a new issue in Jira - instead all I get is:

    Step 2 of 2: Enter the details of the issue...

    You have not selected a valid project to create an issue in.

    1. Sep 16, 2009

      Anonymous

      heh, yea, click on new issue and use the linmk in your browser...

      1. Sep 16, 2009

        lol, yeah - that'll do it (smile)

      2. Sep 17, 2009

        When I use:

        /secure/CreateIssue!default.jspa?

        Instead of:

        /secure/CreateIssueDetails!init.jspa?

        It does give me the page where you select the project and type but when you click next, the issue details page does not contain any of the field values entered in the original query string.  The issue is blank.

  14. Sep 27, 2009

    kaz

    I agree that it would be great for this link to be improved so that it just opens an issue rather than trying to create (save) an issue.

    I'll find the place for posting improvement requests.

    -kaz

    1. Oct 08, 2009

      are you trying to go straight to the view screen of a new issue which the link creates? (so no screen with the form filled out where you have to click save)

      try this

      Creates issue straight away with no confirmation screen

  15. Oct 20, 2009

    Is it possible to Update an issue by using URLs (instead of Creating)? Eg I tried to update the priority using

    but there are two problems:

    • Fields that are not specified in the URL are emptied (eg Summary) so this gives validation (red) errors
    • The page is not submitted, so the new value is only selected, but not committed (also asked here)
  16. Nov 02, 2009

    Salutations,

    Is it possible to create a new issue and then link it to the current issue using this method?

    Thanks in advance.

  17. Jun 29, 2010

    I don't get this working for creation of subtasks: the summary is not filled...

    URL looks like http://www.jira.funda.nl/secure/CreateSubTaskIssue\!default.jspa?pid=10101&parentIssueId=49882&priority=3&issuetype=5&summary=Some+Text&reporter=mark, 

    All works fine except for the summary. Can someone help me out? 

    1. Sep 02, 2011

      I have the same issue. Have you solved it Susan ?

      Kind regards

      Kenneth

      1. Sep 04, 2011

        Try using CreateSubTaskIssueDetails.jspa instead. You can use the JIRA Command Line Interface createIssue action with parent specified to create subtasks. Use the -v option to see the URL that is being used. The same URL should work directly.

        1. Sep 05, 2011

           Much better! Thank you !

        2. Sep 05, 2011

          I run into form token problems though. When i try to fire the   CreateSubTaskIssueDetails.jspa command i get the "JIRA could not complete this action due to a missing form token....... Press retry operation".

          How do i get the token?  I tried to provide credentials as parameters ie. os_username = ... and os_password = ... That didn't work. Also tried with basic authentication. Didn't work either.

          Kind regards

          Kenneth

          1. Sep 05, 2011

            Nevermind. Using os_username and os_password in the URL and adding X-Atlassian-Token: no-check  to the header helped (big grin)

  18. Jul 06, 2010

    Is there a way to force/lock fix Version to unknown and asignee to unassigned without forcing other options on that page?

    What I want is users being able to create bug (issue type of bug and project are specified) which must be unassigned and version must be unknown.

  19. Jul 26, 2010

    I'm successfully using "CreateIssueDetails.jspa?" to create issues, but for this next case, I don't want the issue automatically created, but instead, just populate the fields and let the user change the description before clicking "Create".

    Is there a variation on the URL to do this? 

    1. Aug 11, 2010

      Anonymous

      Construct the same link as you were before except instead of "CreateIssueDetails.jspa" use "CreateIssueDetails!init.jspa".

      1. Aug 11, 2010

        At least for me, changing "CreateIssueDetails.jspa" to "CreateIssueDetails!init.jspa" gives the exact same behavior - It is still trying to post the form and erroring out on a specific field.  This is with JIRA 3.13

        1. Aug 11, 2010

          Anonymous

          Which field is it? If it's the summary, that happens for everyone, unfortunately (as noted above).

          1. Aug 12, 2010

            In my case, it is the priority field, because I'm not passing a value, but that's not the point.  The point is that it still tries to post the document and comes back with the red highlight that the field must be provided - Exact same behavior if the user had clicked "Create"

  20. Nov 19, 2010

    Anonymous

    I want to post a link for staff to quickly access the 'Create Issue' page with the Project and Issue Type defaulted. The below link works perfectly if the user is already logged in to Jira but if they aren't they receive the page, without the Project and Issue Type fields, along with the message "You have not selected a valid project to create an issue in".

    https://jira.netdev.co.uk/secure/CreateIssue\!default.jspa?selectedProjectId=10003&issuetype=33 (https://jira.netdev.co.uk/secure/CreateIssue\!default.jspa?selectedProjectId=10003&issuetype=33)

    If I use the following link without the user logged in they receive the below meaningful message but I do not want them presented with Step 2 after logging in...

    https://jira.netdev.co.uk/secure/CreateIssueDetails\!init.jspa?pid=10003&issuetype=33&priority=6 (https://jira.netdev.co.uk/secure/CreateIssueDetails\!init.jspa?pid=10003&issuetype=33&priority=6)

    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 login

    How can I get the first URL to display the message given by the second URL if the user isn't logged in?

    If I use 'pid' instead of 'selectedProjectId' the correct message is displayed but once logged in the wrong Project is defaulted?

    https://jira.netdev.co.uk/secure/CreateIssue\!default.jspa?pid=10003&issuetype=33 (https://jira.netdev.co.uk/secure/CreateIssue\!default.jspa?pid=10003&issuetype=33)

  21. Apr 04, 2011

    I've got my pid and issuetype working.  I can assign a base assignee, but how can I assign the base reporter as the current user?

  22. Apr 21, 2011

    any way to add attachments?

  23. May 26, 2011

    How can I add more than one label or component?

    I was trying to do something like MyLabel1,MyLabel2,MyLabel3 but... nothing.

  24. Jun 03, 2011

    Anonymous

    I need to give in description an xml and what I am doing is to encode it using CGI.escape but it is not working

  25. Aug 16, 2011

    Anonymous

    Is it possible to add a attachment?

    Thanks

  26. Aug 26, 2011

    Anonymous

    Is "comment" an acceptable parameter?

  27. Sep 20, 2011

    Anonymous

    An earlier post by Matthew Cobby looked like it was going to answer my question but there was no code where I presume there should have been.

    How can I create AND SAVE the issue without the user seeing the Create Issue screen and then having to click on the Create button.

    1. Sep 26, 2011

      CreateIssueDetails.jspa

      Example: CreateIssueDetails.jspa?pid=10190&issuetype=3&os_username=....&os_password=....&summary=.......... etc

  28. Sep 23, 2011

    How to pass an "advanced" issue description with line breaks and other stuff when using CreateIssueDetails.jspa?   fx descrition =One+Line\nThe+Seconde+Line    to give the result when viewing the issue in Jira:


    One Line

    Second Line

    1. Sep 23, 2011

      Ohhh. I just pass on JIRA wirki markup url encoded. Fx \\ is a linebreak so putting %5C%5C in the url does what i need it to do! (big grin)

      1. Sep 26, 2011

        Or so i thought. I cannot get lists and stuff like that to work.

  29. Sep 26, 2011

    How do you pass wiki markup in the URL? fx a description containing a table or list defined in wiki markup? I cannot seem to get it to work.

  30. Oct 03, 2011

    Anonymous

    I have added a custom field: Dependent Task that will have a drop down. I would like this drop down to include the options for all other tasks within my project.  Does anyone know how to go about doing this?  Does anyone have the code (if HTML) is required?

     

    Thanks!

  31. Dec 09, 2011

    In case someone doesn't know, you can obtain the PID by in JIRA going to the project in question, then right click the "Create: Bug" or what have you, and then clicking ""Copy Link Location" or equivalent. 

     

     

    You get something similar to this in your clipboard (ctrl-v) buffer http://[SERVER ADDRESS]/secure/CreateIssue.jspa?pid=10002&issuetype=9

  32. Feb 01, 2012

    Anonymous

    How do you pass wiki markup in the URL?