Crucible REST API: rest-service-fecru/user-prefs-v1 request body

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? 

1 answer

1 accepted

Accepted Answer
0 votes

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 

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Monday in Jira Ops

Jira Ops Early Access Program Update #1: Announcing our next feature and a new integration

Thanks for signing up for Jira Ops! I’m Matt Ryall, leader for the Jira Ops product team at Atlassian. Since this is a brand new product, we’ll be delivering improvements quickly and sharing updates...

325 views 0 8
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you