Hack: Issue Creation URL for JIRA

Below details the process on how you can create these URLs. It isn’t an easy process and requires a lot of hoop jumping, but depending on your use cases can provide a lot of different benefits.
Note: This was only ever tested on the server version of JIRA and has not been tested on the cloud version
Possible Use Cases
- Creating a button on a Confluence page to enable users to create bug tickets for a feature directly
- Utilising Excel or another spreadsheet to create the custom URLs on test plans or feature check lists
Creating the Base String
Lets first look at the URL structure so you can understand the approach and get better aquatinted with the approach:
https://jira.Yourdomain.com/secure/CreateIssueDetails!init.jspa?pid=
The above is 100% required and tells JIRA that you want to create an issue. You then need to define the project (pid) and also issue type (see below)
Getting the PID
pid=0000&issuetype=0000
The easiest way to get a PID is:
1. Point your browser at: https://jira.Yourdomain.com
2. Once there right click on the blue “Create” button at the top of the screen
3. Select Open in New Window
Go to the new window which was open
a. If you have an error, usually a page refresh fixes this
5. Select the project you want the issue to be entered on
6. Click the “Next” button
7. Right click on the white space and select “View Page Source”
8. A new window is open, go to that window
a. If you have an error, usually a page refresh fixes this
9. You will see a bunch of code (needle in a haystack) on your keyboard press CTRL+F to enter the find mode
10. type in pid and hit search
11. You are looking for the pid value and will look something like this: value=”0000" and will maybe be the 3rd pid value
Now you have the PID of your project you can fill in the pid into the url after “pid=”
Getting the IssueType
Below is a cheat sheet of the common types. If you have a custom issue type you will need to use a similar approach to above which can also be seen below.
- Bug = 1
- Task = 3
- Sub-Task = 5
- Epic = 7
- Story = 8
If you have a custom Issue Type or its not shown above you need to-do the following:
1. Point your browser at: https://jira.Yourdoamin.com
2. Once here right click on the blue “Create” button at the top of the screen
3. Select Open in New Window
4. Go to the new window which was open
a. If you have an error, usually a page refresh fixes this
5. Select the project you want the issue to be entered on and also the issue type you want
6. Click the “Next” button
7. Right click on the white space and select “View Page Source”
8. A new window is open, go to that window
9. You will see a bunch of code (needle in a haystack) on your keyboard press CTRL+F to enter the find mode
10. type in issuetype and hit search
11. You are looking for the pid value and will look something like this: value=”000000" and will maybe be the 3rd pid value
Now you have the Issue Type number of your project you can fill in the issuetype value in the URL. What you need to do now is after the pid you need to type “&issuetype=” followed by the number for the issue type you have
Finished URL
https://jira.Yourdomain.com/secure/CreateIssueDetails!init.jspa?pid=00000&issuetype=000000
You should be able to take the URL you just created and enter it into any browser and you should be taken to JIRA with the Project and Issue Type already selected.
Filling in fields with the URL
So now you have a link which can open up JIRA to a creating a ticket page for a specific project and issue type but you need a little more. In general all fields on the page can be pre filled in via the URL and you can create a very rigid and complex string for this. Below I will cover the basics that apply throughout and you can take this and apply it to your needs.
Hopefully you have a base string that looks like the below:
https://jira.Yourdomain.com/secure/CreateIssueDetails!init.jspa?pid=00000&issuetype=000000
You have defined the Project Issue Type, but now you want to pre fill in some fields. You need to remember that after every section that you need to use & as seen in the base string above (pid=value&issuetype=value)
So there are 2 types of issues:
- Standard Types
- Custom Types
Both require different approaches for this JIRA via URL process. Below you will see a breakdown on each and you can combine this to go crazy.
Standard Field Types
Generally this is for example Summary, Description, label and priority. There are some others but of the top of my head I don’t know them.
1. Create a base URL as explained above
2. We want to fill in the Summary field with “This is a test”
All you need to do is add at the end: &summary=This%20is%20a%20test
3. You will end up with the following: https://jira.Yourdomain.com/secure/CreateIssueDetails!init.jspa?pid=000000&issuetype=1&summary=This% 20is%20a%20test
a. Once clicked a Bug Ticket for the assigned project will be opened with the Summary field saying This is a test
Tip
To make life a lot easier I would recommend using the browser to fill in the URL in the correct syntax for you as it saves a lot of time. For Example:
- In the address bar have: https://jira.Yourdomain.com/secure/CreateIssueDetails!init.jspa?pid=000000&issuetype=1&summary= 2
- Now in the address bar type in plain text what you want the summary to say and press enter
- The browser will correct the string with the correct syntax
Please Note
Specific symbol sets will break the string if you use them directly. To fix this you need to use the HEX code for the symbol in the strong. I recommend going here: http:-www.url-encode-decode.com/ and encoding the symbol you need to get the HEX value which you can use in the string
For Example:
We want to use the % symbol in the string
Won’t Work: https://jira.Yourdomain.com/secure/CreateIssueDetails!init.jspa?pid=000000&issuetype=1&summary=this%20%%20wont% 20work
Will Work: https://jira.Yourdomain.com/secure/CreateIssueDetails!init.jspa?pid=12741&issuetype=1&summary=this%20%25%0D%0A% 20wont%20work
%25%0D%0A is the HEX code for % and now the string is parsed and works correctly
Custom Field Types
For this we need to use a similar method to what we used for the pid. Below is an example on how we can do this and apply it to all custom fields. For this example we will look for the Custom Field called Affected Tools in the Core QA bug type.
1. Point your browser at: https://jira.Yourdomain.com
2. Once here right click on the blue “Create” button at the top of the screen
3. Select Open in New Window
4. Go to the new window which was open
a. If you have an error, usually a page refresh fixes this
5. Select the project you want the issue to be entered on and also the issue type you want
6. Click the “Next” button
7. Right click on the white space and select “View Page Source”
8. A new window is open, go to that window
9. You will see a bunch of code (needle in a haystack) on your keyboard press CTRL+F to enter the find mode
10. type in the custom field name and hit search
11. You are looking for the id for the field which will look like: customfield_000000
12. This is a selection box and because of this the values for the selection is also a number. You will be able to see this when you are searching for the custom field name
https://jira.Yourdomain.com/secure/CreateIssueDetails!init.jspa?pid=000000&issuetype=1&customfield_000000=12440
The above example shows a custom field being field with a custom value.