Hi Everyone a NewBee here,
Maybe this is not the right group to ask this question in so please enlighten me if this is the case where to drop this type of questions.
I'm more a database/query kind of guy but unfortunately the policy here is to use REST API. So my question is.
Is there a way to retrieve all projects which are missing a specific custom field in a specific Issue Type via REST API? preferably via chaining REST API calls instead of having to run different calls for each project separately.
Thank you for you help.
Gr,
Sudhier
If you're a DB guy it'll be easier to do it via the DB I imagine.
Just join up some of the custom field, field context and project tables, Pull the list of all the correct ones, then tell it to spit out all the projects that aren't in the first list.
Although, doesn't that just mean you should be setting the field context to global? Sometimes can be easier than continually updating a context.
Hi Steve,
True unfortunately the policy is not to just query or modify the database directly (which is also recommended by Atlassian) and use REST API instead. So here they follow these guidelines along side the fact that REST API calls are logged and therefor auditable.
I'll look in to setting the field context to global. Not yet familiar with this but if it will solve my question, why not. Thank you for your help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ah right yeh I was more talking about the identifying of which projects you need to do it for via the front end, I will say that given on occasion Atlassian's guidance in support calls and also in some of their docs is to make a db modification, it's not always off the table. Although for something so foundational as field related changes I'd air on the safe side
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sudhier Nannan,
Thanks for your question. One way to fetch all projects with missing custom fields in a specific issue type over Jira REST API is to query these issues in JSON format using JQL. After that, you could parse out the project details of interest from the JSON. Please note that this approach only allows querying issues and projects you have access to.
Example:
{ "expand": "schema,names", "startAt": 0, "maxResults": 50, "total": 50, "issues": [ { "id": "12345", "key": "PROJECTKEY-1", "fields": { "customfield_CUSTOM_FIELD_ID": null,
"issuetype": { "id": "ISSUE_TYPE_ID", ... }, "project": { "self": "https://yourjiradomain.com/rest/api/2/project/67890", "id": "67890", "key": "PROJECTKEY", "name": "This is one of the projects we are looking for", "projectTypeKey": "software", ... }, ... } }, ... ] }
Hopefully, this answers your question!
Regards,
Alex
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.