I want to create JIRA Change Request Ticket using a template.
Below is the format of the data sent to JIRA. I have tried using the projectTemplateKey parameter along with this request. But I am not sure if this is the right way.
Could anyone please help?
payload =
{ fields:
{ project: { key: "CRQ"},
customfield_15630: "SampleTemplateName",
summary: "Testing",
customfield_17679: "N.A" ,
customfield_14530:"2018-06-17T00:00:00.0+0000 ",
customfield_14531: "2018-06-17T00:00:00.0+0000 " } }
I'm not sure what you mean by "template". Your call to create an issue looks ok to me, so I'm not sure what's going wrong.
The xml you've given is of no use for REST calls, so I'm guessing I am missing some part of a process you are going through that you've not explained.
As an aside, projectTemplateKey is not a parameter I recognise, could you explain where you found it in the REST API docs and what you think it does?
The JIRA Change request has a field called 'Template' , so when it is selected some fields are automatically populated and related services and subtasks are created along with the ticket.
So I am trying to create a ticket from a template using REST API.
But when tried to add the template value as below,
customfield_15630: "SampleTemplateName",
Error message from the JIRA response
400 Bad Request: {"errorMessages":["We can't create this issue for you right now, it could
be due to unsupported content you've entered into one or more of the issue fields.
If this situation persists, contact your administrator as they'll be able to access more
specific information in the log file."],"errors":{}}
I would like to know if creation of ticket from template is possible using REST api ?
I found the projectTemplateKey parameter from here. Not sure if it is related.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Do you mean that you want to create a Service Desk Request? Then you should use Jira Service Desk API to create a request.
That is how you should create it
https://developer.atlassian.com/cloud/jira/service-desk/rest/#api-request-post
The post you linked to your message is about project templates. They do exists in Jira. Project templates let administrators create projects with certain workflow schemes, screen schemes etc. You do not need it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ah, I think that helps me understand the problem.
You are NOT trying to create an issue from a "template", you have a field that has some hacks on it that manipulate the user's browser into filling fields for them.
You have not configured REST calls to do the equivalent in background code.
In reality your "template" field is simply a custom field. Your REST call is not replicating all the logic you've set up in your template hack, so it's failing.
If you re-read the link you've given again, you should see that the projectTemplateKey is a function of creating projects. Projects are not issues.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If I'm not mistaken, you're using Issue Templates - that's why @Alexey Matveevand @Nic Brough -Adaptavist- were a bit confused :)
The error message that you've attached was related to a bug, when more than one app's post function were stacked and conflicted with themselves. This has been fixed recently - simply update the app at the Marketplace, and the error should be gone.
Your payload is lacking an issueType parameter, which is required for Jira to create an issue. The templateProjectKey parameter is related to project templates, not issue templates.
Here's an example of a proper issue creation from a template via REST API: https://intenso.atlassian.net/wiki/spaces/IT/pages/110270245/NEW+Create+via+Rest+API
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Intenso documentation page about API moved to https://deviniti.com/support/addon/server/issue-templates/latest/app-integrations/
In their example, change customField_10000 by your Templates custom field, and change the associated value with the Template ID that you want to use for creation.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
What REST API do you use? What is project template key?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I use JIRA API endpoint '/rest/api/2/issue' .
<item><title>[TMPL-167] NTW-8 [Network_Interface_configuration]</title><link>https://jiraqa.com/browse/TMPL-167</link><project id="15980" key="TMPL">Templates</project><description>Test</description><environment/><key id="492895">TMPL-167</key><summary>NTW-8 [Network_Interface_configuration]</summary>
Here's the xml format of the template I want to use for the ticket.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Kindly try to answer @Nic Brough -Adaptavist-question about the template. I also can not figure out what you are up to with the template.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.