It's all about the answers!

Ask a question

RDNG mass user provisioning scripts


0
1
Rakesh Ramgounda (1136) | asked May 24 '16, 1:32 p.m.
edited Jun 14 '16, 10:10 a.m.

Currently we are on 6.0.1 version and I would like to know is there a way to provision multiple users to work areas using scripts.

It will help to automate user provisioning and help support team on user provisioning requests. I am looking something like multiple users can be added to excel spreadsheet with role permission details and script can be run to provision users.

Here is article that has batch file script.

https://jazz.net/library/article/633

When updated script and executed, able to authenticate successfully but fails to add members to work area. It doesn't give much details in log except saying "Adding members"

Log file shows.


Comments
Donald Nong commented Jun 14 '16, 9:44 p.m. | edited Jun 14 '16, 9:45 p.m.

It uses cURL, just like a mini browser. You need to check the response to find out why the POST operation fails. Remove the "echo off" at the top of the script so that cURL will output the response in the console.


Also, make sure you log in as a Project Administrator in order to add members.


Rakesh Ramgounda commented Jun 15 '16, 12:11 a.m. | edited Jun 15 '16, 2:40 a.m.

Thanks Donald for response. I did remove echo off and able to get couple of extra message after Add members in log file.

C:\1-SRE\RDNG\script>echo Adding members...
Adding members...

C:\1-SRE\RDNG\script>setlocal enabledelayedexpansion 

C:\1-SRE\RDNG\script>   echo ^<jp06:members xmlns:jp06="https://jazz.net/xmlns/prod/jazz/process/0.6/"^ > >> postBody.xml

I do have admin rights in work area.


Rakesh Ramgounda commented Jun 15 '16, 12:16 a.m.

Thanks Donald for response. I did remove echo off and able to get couple of extra message after Add members in log file.

C:\1-SRE\RDNG\script>echo Adding members...
Adding members...

C:\1-SRE\RDNG\script>setlocal enabledelayedexpansion 

C:\1-SRE\RDNG\script>   echo ^<jp06:members xmlns:jp06="https://jazz.net/xmlns/prod/jazz/process/0.6/"^ > >> postBody.xml

I do have admin rights in work area.

One answer



permanent link
Donald Nong (14.5k614) | answered Jun 15 '16, 2:51 a.m.
There appears to be a typo in the sample script. If your script just stops at the last line that you posted, it should sort of prove it.

There is an extra space in the code "^ > >> %POST_BODY_FILE%". It should have been "^> >> %POST_BODY_FILE%" - there should be no space between the first caret symbol (^) and the first right angle bracket (>).

You can see this combination "^>" (and "^<") appearing many times in the script. It is to "escape" the angle brackets (<) and (>) so that they can be "echoed" into the file %POST_BODY_FILE%.

Check your script carefully if any such extra spaces exist. If so, remove them. Then run the script again.

Comments
Rakesh Ramgounda commented Jun 15 '16, 8:26 a.m.

Thank you Donald, That's it, the extra space between first caret symbol (^) and the first right angle bracket (>) resolved script error. However, I am having trouble with csv file. We have ID such as example "rr1568" RAMGOUNDA, RAKESH.

When I add ID in first column such as rr1568, log says user added to workarea but when I check I do not see any user added.

When I try to add by name RAMGOUNDA, RAKESH, it gives following message "curl: <6> Could not resolve host: RAKESH

I tried adding % where is space between my last name and first name and in double quotes, still gets same message.

Please advise

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.