I am trying to create one project and under that new created project 5 task. However getting an error in Jira Automation through REST API.
Could you please help me in this? Creation of Project is working but when I am trying to add issue I am getting an error.
I am trying to create a new project and, under that newly created project, add 5 tasks using Jira Automation through the REST API. While the project creation works successfully, I encounter an error when attempting to create the issues (tasks). Could you please help me resolve this issue?
However Same REST API body is working in Postman but when I am trying to add through "Send Web Request" Getting an error
Hi @Deepak Rai ,
Are you trying to create project and issues within the same rule? From the screenshot above, first web request is trying to create a project and the second (immediately after) is trying to create issues within the project created by first web request?
If so, I think the project creation is 'not that fast' > by the time you're trying to send next request, system didn't manage to create project from the first web request and therefore you're getting an error.
I would suggest using Delay action (although this is only available in Premium & Enterprise editions); or, somehow, just trigger that next web request a minute or so later than the first one. You can try creating a separate rule which would contain only action for creating issues in existing project to see if that's working. I've tested it with the same custom data from your screenshot and it seems to be working fine.
Cheers,
Tobi
Hi @Deepak Rai
Yes, and...to the suggestions from @Tomislav Tobijas _Koios_
Creating a project takes time, and rather than estimating the amount of time to use in a Delay action, perhaps use two automation rules to allow Jira to determine the timing:
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you @Bill Sheboy and @Tomislav Tobijas _Koios_ for response and this really helps. I tried adding the delay of 30 seconds and 1 minutes. However when I am trying to send response with smart values I am getting an error.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Deepak Rai have you tried testing rule which would only create issue(s) in existing project with web request? Just to be sure if it works/doesn't work on existing project.
For example, this works for me:
{
"fields": {
"project": {"key":"{{project.key}}"},
"issuetype": {"name": "Task"},
"summary": "Task Summary"
}
}
Also, I guess the project you're creating has issue type named "Task" in issue type scheme assigned to that project?
If you would try to get issue types for created project, what are you getting as a response?
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.