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

This widget could not be displayed.

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
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted yesterday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

49 views 1 0
Join discussion

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