Hi Community,
I have a Jira Server v9.4.14 setup installed in Linux VM. Everything works fine as per requirement. Except some customization code which calls REST APIs to Jira getting failed for Archived projects.
We have below REST API calls used in code
GET:{base_url}/rest/api/2/issue/createmeta/{project_key}/issuetypes/{issueType_id}
GET:{base_url}/rest/api/2/project/{project_key}
These API's are called java.net.URL package...
If project is not archived then these API calls return data as expected and rest of the code functions without an issue.
However, we have some jira performance issue and we're considering Archiving some projects and jira issues.
Even though the projects are archived, we still have some logic that depends on these archived project including above a function that calls above REST APIs.
And for these Archived projects, the above GET REST APIs does not return the response ( 400 - Bad Request )
Is there a way that above APIs can be still functional for archived projects as well or are there different API methods to get same response as above REST APIs does?
I hope the above explanation is understandable.Please let me know your suggestions.
Thank you
As detailed here, archiving a project removes it from several places:
It's not written here, but I assume the REST API is intentionally also affected - so I wouldn't have too high hope that you can achieve this. If projects are getting archived, they'll be in a read-only mode.
I'd question more: Why do you still need to access them? If you need to access them, they probably shouldn't be archived.
Hello @Matthias Gaiser _K15t_
Sorry for delay in my response.
In order to answer your question on why we still have a requirement where we need to access Archived project is mainly due to customisation that we made in jira.
We have 2 jira projects that acts as one primary and another secondary project.
Primary Jira project : Mainly used by end users to create issues. We have customised this project configuration with customfields, behaviours and so on according to our need.
Secondary Jira project : The main role of secondary project is to provide required metadata to the primary project. When end user creates an issue with Primary project, the logic is that it calls below API as mentioned in my above question,
GET:{base_url}/rest/api/2/issue/createmeta/{project_key}/issuetypes/{issueType_id}
to get project customfield metadata and this metadata like options are provided in create screen, edit screen for end users.
So, mainly we use secondary project for reading metadata and customisation logic is built around it in Jira with the help of plugins and scripts.
The project key names in jira for these primary and secondary projects are configured such as way that for example: for proj_1 for primary project and sub_proj_1 for secondary project...so by adding "sub_" we can access secondary project. This is to call APIs dynamically from primary project to it's secondary project.
As you may have understood that, if we archive secondary projects, it should not affect above functionality. But this is not happening.
When we archive secondary project and when primary project calls the above API in logic, it returns "Bad Request" and further disrupts the functionality.
The solution could be, we can modify the code in such away that we can remove this secondary project dependency for primary project. This modification would be huge task as there are multiple primary projects with different sort of customisation and one solution cannot work for all primary projects.
Another simple solution would be even if secondary projects are archived, the REST APIs should work for reading project data at-least as we don't want to modify archived projects as well. This could work for all primary project in one shot.
I was hoping to make it work as per second solution but in Jira, it is not working. That's where I need community's help.
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I can confirm what @Matthias Gaiser _K15t_ has said; when you archive a Project, it and all its sub-components are no longer accessible via the REST API.
So, you have two choices:
1. Don't archive those secondary projects
2. Implement the solution you have already identified... "modify the code in such away that we can remove this secondary project dependency for primary project"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Understood.
Currently going with option.2
It's a long shot but it will be permanent and more flexible approach.
Thank you @David Bakkers and @Matthias Gaiser _K15t_
Appreciate your suggestions.
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.