Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

How can i set issue restriction when using Jira API to create an issue?

When using the Jira API (v2) i also like to set the Restrictions.

I did try to set it using:

fields: {issuerestriction: { 'issuerestrictions': { 'projectrole': [ {'restrictionValue': 'xx'} ] } }

This returns me an error when using the API:

{"issuerestriction":"Can not deserialize instance of java.util.ArrayList out of VALUE_STRING token\n at [Source: N/A; line: -1, column: -1]"}}

Is there an other way to set the Security level / Restriction when using the API for a Next-Gen project?

 

1 answer

1 accepted

Hi

It seems that you're not using the right payload for your update. As you're calling the key "issuerestriction" twice and all keys should be wrapped in quotes (depending on which language you use). Your payload should look like the below sent with a "PUT" HTTP method

payload = {
"fields": {"issuerestriction": {"projectrole": [{"restrictionValue": "10xxx"}]}}
}

Where value "10xxx" is the project role id. With that, you can set the restrictions on your Team Managed projects.

Tnx that working!!.. I was looking to the structure when i did a get on a ticket.. and then it shows it like that.


Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events