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
i finally got it working.
import requests
import json
import Projects
jiraSession = requests.Session()
username = username
password = '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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.