Manipulate Profiles through REST

since 3.1.6

The following is the list of public API’s which can be used to drive different functionality on JEMH Profile.

Exporting Profile XML

This will export a single profile nominated by Profile Id to file profile.xml

To export the group profile, nominate the Default Profile Id from group profile.

 

1 curl -u admin:admin -X GET -H "X-Atlassian-Token: no-check" http://localhost:8080/rest/jemh/latest/public/profile/export?profileId=1 > profile.xml

Import/ Upload new

This will import the file profile.xml from the current folder into JEMH (works for both Independent/Group Profile). Additional parameters are to be provided (defaulted to false):

  • Auto-create Missing Projects

  • Auto-create Missing Custom Fields

  • Fix Users

  • Fix Issue Types.

 

1 curl -u admin:admin -F "uploadProfile=@profile.xml" -H "X-Atlassian-Token: no-check" 'http://localhost:8080/rest/jemh/latest/public/profile/import?fixProjects=true&fixCustomFields=true&fixUsers=true&fixIssue=true'

Update from file

This will upload the file profile.xml from the current folder, causing the profile nominated by Profile Id to have its configuration updated. This process is not atomic, we remove all Project Mappings, and rebuild from the supplied configuration, all remaining values are ‘set’ live, i.e, such updates should be done in a maintenance window.

 

1 curl -u admin:admin -F "uploadProfileXml=@profile.xml" -H "X-Atlassian-Token: no-check" http://localhost:8080/rest/jemh/latest/public/profile/update?profileId=1

Delete profile

Delete the profile nominated by id. To delete the group profile, nominate the Default Profile Id from group profile.

 

1 curl -u admin:admin -X DELETE -H "X-Atlassian-Token: no-check" http://localhost:8080/rest/jemh/latest/public/profile/delete?profileId=3