The settings or preferences for a given user in Jira Cloud are stored in a number of locations within the system. The User Properties section contains settings relating to which interface elements the user sees or doesn’t see.
For example, when you first access ScriptRunner on a Jira instance, you’re presented with a little quiz. It looks like this:
After you click through this quiz it goes away forever. Someone recently remarked that they’d love to not have their ScriptRunner users be presented with this quiz in the first place.
…Okay, we can make that happen!
First we need to query the user properties for a given user with this code:
def userProps = get("rest/api/2/user/properties")
.header("Accept", "application/json")
.queryString("accountId", "<user account ID>")
.asJson();
return userProps.body
The results look like something like this:
{
"array": {
"empty": false
},
"object": {
"keys": [
{
"self": " https://some-jira-instance.atlassian.net/rest/api/2/user/properties/navigation_next_ui_state?accountId=12345678910abcdef123456",
"key": "navigation_next_ui_state"
},
{
"self": " https://some-jira-instance.atlassian.net/rest/api/2/user/properties/onboarding?accountId=12345678910abcdef123456",
"key": "onboarding"
},
{
"self": " https://some-jira-instance.atlassian.net/rest/api/2/user/properties/project.config.dw.create.last.template?accountId=12345678910abcdef123456",
"key": "project.config.dw.create.last.template"
},
{
"self": " https://some-jira-instance.atlassian.net/rest/api/2/user/properties/sr-post-install-quiz?accountId=12345678910abcdef123456",
"key": "sr-post-install-quiz"
}
]
}
}
The key we’re interested in is the one at the bottom, called sr-post-install-quiz. A new user isn’t going to have this property; it only gets