Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Create bulk issues

Hi When I create issue in bulk, I get this error 

"errorMessages": [],
"errors": {
"project": "Specify a valid project ID or key"
}

When I create an only issue, the project key works fine.
{'project': {'key': 'CJCTP'},

 

Can you please help

2 answers

0 votes
Andy Heinzer Atlassian Team Jul 21, 2021

Hi Saba,

I understand that you are trying to bulk create issues within Jira Cloud, but are seeing this error requesting that you specify a valid project key or ID.  I am not certain of the exact cause here so far. 

When referencing our REST API documentation for that endpoint POST /rest/api/3/issue, it seems to be very similar to your payload however the json in our examples is always using double quotes instead of single quotes.  In some other cases I have found that using single quotes can sometimes cause unexpected behavior, but then again it can also depend upon your environment.  I would be interested to see if we can see a example payload you are using here, it might help me to be able to recreate this problem.

That particular error message can happen for a number of reasons, such as:

  1. The project key does not exist on that Jira site (unlikely in this case)
  2. Your account does not have permissions to create issues in that project
  3. Or the authentication method being used here is failing, which in turn can show this kind of error as Jira will not reveal which project keys are valid if your account does not have permissions to see it (or if authentication fails your call might still try to be processed as an anonymous user).

Looking to understand more about your environment and method being used to try to bulk create issues here to see if we can help.  Please let me know more.

Andy

Hi Andy,

 

Thanks for the answer, but I find it quite strange that this project key and the son payload works perfectly fine when I access the endpoint:

"https://domain.com/rest/api/3/issue" and doesn't with this "https://domain .com/rest/api/3/issue/bulk

So the single quotes and the permission thing is out of the question. 
Here is the JSON payload if you please look into it for me.

{'issueUpdates': [{'update': {'worklog': [{'add': {'timespent': '60m', 'started': '2011-07-05T11:05:00.000+0000'}, 'fields': {'project': {'key': 'CJCTP'}, 'summary': 'test sum1'}}]}}, {'update': {'worklog': [{'add': {'timespent': '60m', 'started': '2011-07-05T11:05:00.000+0000'}, 'fields': {'project': {'key': 'CJCTP'}, 'summary': 'test sum1'}}]}}], 'description': {'content': [{'content': [{'text': '"', 'type': 'text'}, {'marks': [{'attrs': {'href': ''}, 'type': 'link'}], 'text': 'test desc', 'type': 'text'}], 'type': 'paragraph'}], 'type': 'doc', 'version': 1}, 'environment': None, 'fixVersions': [], 'issuetype': {'name': 'Bug'}}

Andy Heinzer Atlassian Team Jul 26, 2021

Thanks for posting this information Saba.  I can't seem to find any clear cause for the behavior reported here.  I'd be interested to try to learn more here to better understand this situation.  Could you let me know more about how you are calling these REST API endpoints? Are these called in a script like powershell, via curl, or some python?  Or are these calls being made within a plugin to Jira Cloud?

I am curious to try to learn more about the authentication method used here, and what headers are supplied when making this call.  Mostly because this kind of error could show up either when the authentication is not behaving as expected, or possibly some other limiting factor (possibly rate limiting, but I don't want to jump to that conclusion without knowing more about how often such calls are being made and how).

Curious to learn more here.

Andy

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you