Hi,
I'm trying to set the watch email user preference using the REST API. It seems I can use the call documented here: https://docs.atlassian.com/fisheye-crucible/latest/wadl/fecru.html#rest-service-fecru:user-prefs-v1
However, the request representation in the docs is empty, so I don't know how to form the POST request.
From /rest-service/users-v1/user, I get the following XML:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<restUserProfileData>
<avatarUrl>https://host/avatar/user?s=48</avatarUrl>
<email>user@domain</email>
<mappedCommitters/>
<preferences>
<elements value="instant" key="watchMode"/>
<elements value="30" key="changesetsPerPage"/>
<elements value="UTF-8" key="uploadcharset"/>
<elements value="5" key="maxFilesPerChangeset"/>
<elements value="51235" key="ideConnectorPort"/>
<elements value="3" key="context"/>
<elements value="patch" key="uploadtype"/>
<elements value="8" key="tabWidth"/>
<elements value="html" key="emailFormat"/>
<elements value="true" key="enableIde"/>
<elements value="file" key="uploadmethod"/>
</preferences>
<timeZone>
<name>PST8PDT</name>
<rawOffset>-28800000</rawOffset>
</timeZone>
<userData>
<avatarUrl>https://host/avatar/user?s=48</avatarUrl>
<displayName>Last, First</displayName>
<userName>user</userName>
</userData>
</restUserProfileData>
So I've tried using the following JSON:
{
"elements" : [{
"key": "watchMode",
"value": "daily"
}]
}
As well as a few others. These all fail, I get the following response:
{
"code": "UnrecognizedProperty",
"message": "Unrecognized field \"elements\" (Class com.atlassian.fecrurestplugin.common.RestUserPrefService$UserPref), not marked as ignorable\n at [Source: org.eclipse.jetty.server.HttpInput@1a6f2dc2; line: 2, column: 16] (through reference chain: com.atlassian.fecrurestplugin.common.UserPref[\"elements\"])"
}
Does anyone know the proper way to form this request?
Hi @Anthony Zepeda,
The https://docs.atlassian.com/fisheye-crucible/latest/wadl/fecru.html#rest-service-fecru:user-prefs-v1 REST API endpoint helps in setting various preferences. Including, for example, the "Highlight one in the Commit Graph tab. This can be achieved by setting the visualisation.highlight property.
There is no available endpoint that provides the ability to set the "Send Watch Emails" in the users' profiles. This can only be changed directly by the user in the profile section.
Thanks, Caterina - Atlassian
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.