Welcome to the Jazz Community Forum
How to export ProcessTemplate At projectArea Level by JAVA API

One answer

I used this query to find numerous posts on Jazz.net that discuss this API. https://www.google.com/search?q=download+process+template+Java+API+site:jazz.net . I would start with the first hit https://jazz.net/forum/questions/216148/export-process-template-from-project-area-via-api-why-do-file-name-suffixes-in-processdescriptionzip-change-between-subsequent-exports
Comments

Hi Ralph,
Earlier we was used to do the same which mentioned in post. creating new definition each time and after export deleting the definition.
but now in web client we have an option to directly export the template at project area level. Is there any such API which i can use to export directly from project level.

From the next two or three answers in the Google search: No.

Hi Ralph,
An last doubt. when i use below API to export ProcessTemplate, its failing to export newly attribute added to project area. for example if if add new attribute to work item, that field is not exported in later export.
IProcessDefinitionHandle processDefinintionHandel = projectArea.getProcessDefinition();
IContent content =
((IProcessInternalClientService) this.teamRepo.getClientLibrary(IProcessInternalClientService.class))
.createProcessDefinitionExportZip(processDefinintionHandel .getItemId().getUuidValue(), new SubProgressMonitor(
subProgressMonitor, 200));

I believe you should really, really read https://jazz.net/forum/questions/216148/export-process-template-from-project-area-via-api-why-do-file-name-suffixes-in-processdescriptionzip-change-between-subsequent-exports completely. Richard explains some issues and corrects how to create a new process-definition from the project area, before downloading it in his answer.

Yes Ralph, I am aware of it and till now we were doing the same.
But now we have faced some issue. we cant export the template which has same name as project area existing on web.
And for this we were creating new definition with time stamp to avoid it.
But now there is an "ICON" in web UI (beside explore PA) where directly export the template from project area level , we are trying another approach by sending project area definition to export, Here we are not able to export new values.

Your code above does not match the code Richard uses.
The button is to "Export Process Template" has been there since several releases and, as far as I can tell, does exactly the same as the Eclipse UI (and createProcessDefinitionFromProjectArea which your code does not use) it extracts a process template. The UI then stores it in the process templates section of RTC, from where you can download the template. You will need a unique ID for the export - this has always been the case as well.

Hello Ralph,
your explanation is likely not correct.
I tried the following:
1. I checked the templates that are already existing on the server. I wrote down the name and id of an existing template.
2. Now I chose an arbitrary project area.
3. I clicked on the mentioned button in the web ui.
4. In the dialog I gave exactly the id and name of the already existing template.
5. I could press on OK and also the zip file got created properly.
6. After that I went to the Templates Overview page in the web client and exported the template whose id and name I hijacked.
7. After downloading the zip and comparing it with the previous zip it is clear that the two zips although having the same file name are belonging to two different process configurations.

Marko, you are correct, I should have pressed the save button. This is a new behavior that I have not worked with. In the past you always had to create a template of the process to download this. My bad.
I have no idea how to find the Java API involved wit this at the moment.