Hello ,
i need to add an user-group developer role of a project.
can some one get me the code to do this using JIRA module on python using basic auth?
thanks
Hi @gagan m s,
Check the code on this link
https://gist.github.com/andrewhancox/5814197
I've used this to clone roles from one project to another.
Make edits where necessary.
i finally got it working.
import requestsimport jsonimport ProjectsjiraSession = requests.Session()username = usernamepassword = 'password'baseURL = 'URL'try : jiraSession.post(baseURL+'/rest/auth/1/session',auth=(username, password)) create()except :print("Please check connection/ Login Details")def create():for i in Projects.users :for j in Projects.project : body = json.dumps({"user" : [ i ] })print(i) response = jiraSession.request("POST", baseURL+'/rest/api/2/project/'+j+'/role/10001',data=body,headers={'content-type': 'application/json; charset=UTF-8'} )print(response.status_code)Projects is a py file which contains ID of Projects and names of Users as list.
It looks like you're new here. Sign in or register to get started.