Crucible API to change the author of Code Review

We are used the Perofrce and Crucible ( and try to develop the pre-commit code review system.

After creating the Code Review request by file, I want to change the author of Code Review to proper user by CLI, JAVA or REST API.

How can I do that ? can you give me some suggestion ?

If you have example code, please share it to me


1 answer

0 vote

Hello Yoo,

This is the latest Crucible REST API reference:

As can be seen, unfortunately there's no REST API call that you can use in order to change the author. Maybe some SQL queries can help?
This one will tell you all the existing users and their IDs. Take note of the ID of the user you want to set as new author:
select cru_user_id, cru_user_name from cru_user;

Now, let's say that the key of the review you've just created is CR-1. This query will tell you what is the author of this review:

select cu.cru_user_id, cu.cru_user_name, cr.cru_name 
from cru_review cr, cru_user cu, cru_project cp
where cr.cru_creator = cu.cru_user_id
and cr.cru_project = cp.cru_project_id
and cp.cru_proj_key = 'CR'
and cr.cru_review_id = 1;

Now you just need to update the author, by running this query:

update cru_review set cru_creator = 2 where cru_review_id = 1;

I hope this helps!

Suggest an answer

Log in or Join to answer
Community showcase
Alexey Matveev
Published Saturday in Jira

How to run Jira in a docker container

Everything below is tested on Ubuntu 17.10. I prefer to use Jira in a docker container because: 1. I can install Jira with a couple of commands. 2. I can start and stop Jira just by starting and s...

449 views 6 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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot