Create bulk issues

Saba Ghani July 20, 2021

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
Saba Ghani July 23, 2021

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
Atlassian Team members are employees working across the company in a wide variety of roles.
July 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

Saba Ghani August 1, 2021

Hi Andy,

Thanks for the detailed answer, The problem has been resolved so far. 
But I'm still unable to make my head around on how to convert the whole bunch of .csv files into the Atlassian document format, which is laterally a struggle.
Calling with one record works fine with me.

Can you please guide, to who Can I seek technical help?

I'm using python for such.

Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 3, 2021

Hi Saba,

Our support offerings only have support here in Community for end users of cloud sites like yourself.  That said, if you can reach out to your Jira Cloud site admin (Costas V), that person could create a technical support case if you are still having problems by going to https://support.atlassian.com/contact

However if you were to visit that address your request would be redirected here to Community again because your account is not a site-admin.

In this case, I would push to create a support ticket that way.  Mostly because if we need to collect any kind of personal data our standard support channel is the preferred means to troubleshoot these kinds of problems.  I suspect that there could be a problem in regards to the authentication or rate limiting of some kind given the type of error message you are seeing here, but I agree that a more in depth investigation is probably needed at this point.

Andy

0 votes
Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 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

Suggest an answer

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

Atlassian Community Events