Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to POST multiple branch restrictions in single JSON data variable

Andrew
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 22, 2019

I'm using the Python requests library and I'm trying to create a JSON payload that will add two permissions. Right now, I have a "raw_data1" and a "raw_data2" for each individual permission change, and I do a "requests.post" for raw_data1, and again for raw_data2. It works, but I'd like to combine them.

How can I combine them into one? I can't find much information anywhere, other than I'm pretty sure it's possible. I've already tried putting square brackets at the beginning and end, turning them into a list. Doesn't seem to work - gives me an error 500. 

Here's what they look like (Again, they work like this, but I want to combine them):

raw_data1 = {        
"kind""require_approvals_to_merge",        
"users": [],        
"pattern""",        
"value"2,        
"branch_match_kind""branching_model",        
"groups": [],        
"branch_type""development",        
"type""branchrestriction"    
}
    

raw_data2 
= {        
"kind""push",        
"users": [],        
"pattern""",        
"branch_match_kind"
"branching_model",        
"groups": [],        
"branch_type"
"development",        
"type""branchrestriction"    
}     
    

jsonData1 
= json.dumps(raw_data1)    
jsonData2 
= json.dumps(raw_data2)

 

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events