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

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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published yesterday in Jira Software

How large do you think Jira Software can grow?

Hi Atlassian Community! My name is Shana, and I’m on the Jira Software team. One of the many reasons this Community exists is to connect you to others on similar product journeys or with comparabl...

135 views 4 5
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