Unable to Create Issue viia Jira Automation

Deepak Rai
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 29, 2024

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 erroError.JPGJira_REST_API.JPGPostman_API.JPGr

3 answers

3 votes
Tomislav Tobijas _Koios_
Atlassian Partner
December 29, 2024

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

1 vote
Bill Sheboy
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.
December 29, 2024

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:

  • The first rule creates the project
  • The second rule has a global-scope using the Project Created trigger to add the tasks using the built-in Create Issue action

Kind regards,
Bill

0 votes
Deepak Rai
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 29, 2024

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.

Error2.JPGError3.JPG

Tomislav Tobijas _Koios_
Atlassian Partner
December 30, 2024

@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"
}
}

2024-12-30 09-19-53.png

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?

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events