The docs for Jira Cloud are a bit contradictory about whether an addon can store properties against a user. https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/
This page says it’s possible, yet links to the Cloud API reference which says addons don’t have access to the user property endpoints.
The page was last updated in August 2017, and the API reference page doesn’t seem to have a last updated date on it.
I’m even having trouble using /rest/api/2/user/properties outside of the addon. I’ve explicitly added properties to my user and I get an empty array back for the keys.
Yes the ones that are set in the UI are different. You can GET them with the userProperties API but they are not available to apps and therefore not really useful. As an app, you should be using /rest/api/2/user/properties/.
The properties API accepts PUT, not POST. So to set a user property, your request would be something like PUT to https://example.atlassian.net/rest/api/2/user/properties/test-user-prop?username=admin
And to look up that same property: GET https://example.atlassian.net/rest/api/2/user/properties/test-user-prop?username=admin
I’m trying to save user properties from a Jira cloud add-on, but I’m getting a 403 return code. The scenario is that the current logged in user makes a client code to save a property as follows:
Access to Jira, to set a property on the calling user’s record.
Hence my question: for an add-on to save user properties, is there an admin action to perform so that any user using the add-on can save its user properties?