It's all about the answers!

Ask a question

Adding user as project area administrator with API

Jorge Alarcon (411022) | asked Jun 03 '16, 10:50 p.m.
edited Jun 07 '16, 7:55 a.m. by Paul Slauenwhite (8.4k12)

I am using REST API to bulk add a user as project member or project area administrator as it says on this library

It all works fine except when I try to add the user to a project area where the user I am using in to login is not the project area administrator even though I have JazzAdmins and JazzProjectAdmins priviledges doesn't allows me to add the user, however if I go to the web application directly with the same credentials it allows me to add the user.

Can you please advice ?


One answer

permanent link
Donald Nong (14.5k414) | answered Jun 21 '16, 10:50 p.m.
As you said it works fine, I guess you have already figured out the mistakes in the sample script in the article.
echo ^<jp06:members xmlns:jp06=""^ > >> %POST_BODY_FILE%

1. The namespace should start with "http", not "https".
2. There is an extra space just before the closing angle bracket. So (^ >) should be (^>).

While the script should work for CCM, QM and RM, each application behaves a bit differently. The permission issue that you get could be the result of missing HTTP request header "X-Jazz-CSRF-Prevent". The ccm.log file may give a more accurate indication why the operation fails. It's similar to what's been discussed in the below post.
(See Ruby's answer at the bottom of the post)

As far as I can see, RM does not require this HTTP request header for the same operation.

Jorge Alarcon commented Jun 22 '16, 12:30 p.m.


I actually didn't use the sample script since I am using linux bash scripting, I developed my own script to do it and it is working fine with the exception of those project areas where my user is not the project area administrator even though my user has JazzAdmins priviledges, so for those project areas I need to do it using the web gui


Ralph Schoon commented Apr 13 '17, 6:11 a.m.

 Just having JazzAdmins does not automatically grant you all permissions in a project area. You might have to add yourself to the PA administrators and as member to the PA and grant the member a role that has permissions to perform a specific operation. Some, but not all are automatically overwritten if you have JazzAdmin, so you actually can perform the steps above.

Your answer

Register or to post your answer.