You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hi All,
I am facing issue while pushing WRITE permission in deployment plan using rest API. But while pushing READ permission getting success.
Below script from view-source of Bamboo deployment plan
permissions.push({ name: 'READ', label: 'View' });
permissions.push({ name: 'WRITE', label: 'Edit' });
Script Runner script :
def updating_Write_bodyJson = JsonOutput.toJson(["WRITE"] )
def updating_Write_http = new HTTPBuilder( "https://bamboo-abc.com/rest/api/latest/permissions/deployment/${projectId}/groups/${groupName}-${item}" )
updating_Write_http.request(PUT) {
headers."Authorization" = "Basic ${authString}"
body = updating_Write_bodyJson
requestContentType = ContentType.JSON
response.success = { resp ->
log.warn "Updating group premission ${item} of deployment project request Success! with status ${resp.status}"
}
response.failure = { resp ->
log.warn "Updating group premission ${item} of deployment project request failed with status ${resp.status}"
log.warn resp.statusLine
}
}
Error :
2021-08-23 16:25:47,230 WARN [runner.ScriptBindingsManager]: Updating group premission administrators of deployment project request failed with status 400
2021-08-23 16:25:47,231 WARN [runner.ScriptBindingsManager]: HTTP/1.1 400
2021-08-23 16:25:48,407 WARN [runner.ScriptBindingsManager]: Updating group premission developers of deployment project request failed with status 400
2021-08-23 16:25:48,407 WARN [runner.ScriptBindingsManager]: HTTP/1.1 400
Thanks & Regards
Bibin Mohan. K
Hi All,
It worked .
def updating_Write_bodyJson = JsonOutput.toJson(["READ","WRITE"] )
def updating_Write_http = new HTTPBuilder( "https://bamboo-abc.com/rest/api/latest/permissions/deployment/${projectId}/groups/${groupName}-${item}" )
updating_Write_http.request(PUT) {
headers."Authorization" = "Basic ${authString}"
body = updating_Write_bodyJson
requestContentType = ContentType.JSON
response.success = { resp ->
log.warn "Updating group premission ${item} of deployment project request Success! with status ${resp.status}"
}
response.failure = { resp ->
log.warn "Updating group premission ${item} of deployment project request failed with status ${resp.status}"
log.warn resp.statusLine
}
}
Thanks & Regards
Bibin Mohan. K
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.