Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This collection of API’s give the function ality, as can be seen its not a cohesive API yet, we will do this under /jemh/latest/public/profile over time

Status
colourRed
titlesince 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 profileId Profile Id to file profile.xml

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

Code Block
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 upload import the file profile.xml from the current folder as a new Profileinto 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.

Code Block
curl -u admin:admin -F "uploadProfile=@profile.xml" -H "X-Atlassian-Token: no-check" 'http://localhost:8080/rest/securejemh/latest/adminpublic/jemh/JEMHProfiles!uploadProfileXML.jspaprofile/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 profileId 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, iei.e, such updates should be done in a maintenance window.

Code Block
curl -u admin:admin -F "uploadProfileXml=@profile.xml" -H "X-Atlassian-Token: no-check" http://localhost:8080/rest/jemh/latest/apipublic/profile/updateFromXmlupdate?profileId=51

Delete profile

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

Code Block
curl -u admin:admin -X GETDELETE -H "X-Atlassian-Token: no-check" http://localhost:8080/rest/jemh/securelatest/adminpublic/jemhprofile/JEMHProfiles!delete.jspa?idprofileId=53