Update restriction field with automation

Matteo Gabanini June 14, 2024

Hello everyone!

I want to update the restriction field (the one with the padlock) using the automation; the values to put it's the same of a custom field.

I tried to use the JSON format, but it seems that the name "issuerestriction" (I find this name invaked the createmeta API) is not correct.

I hope someone can help me :D

2 answers

0 votes

@Matteo GabaniniJust sharing how I was able to do it on my side

  • Send Web Request
    • Web Request URL: https://<your-instance-url>/rest/api/3/issue/{{issue.key}}
    • HTTP Method: PUT
    • Web Request body: Custom Data
    • Custom Data
      • { 
        "fields": {
        "issuerestriction": {
             "projectrole": [
        {
        "restrictionValue": "<role-id>"
        },
        {
        "restrictionValue": "<other-role-id>"
        }
        ]}
        }
        }
      • the role-id I got by querying an issue that had the restrictions set via UI
    • Headers
      • Content-Type: Application/JSON
      • Authentication: Basic <your-email-address and api-token encoded in base64>
0 votes
Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 14, 2024

Hi @Matteo Gabanini,

Welcome to Atlassian Community!

If you by restriction field means the one that sets the security on the issue then you are looking for the field called security level.

Matteo Gabanini June 17, 2024

Hi @Mikael Sandberg

  thanks for you answer!

No, I mean this field:

Screenshot 2024-06-17 104210.png

I want to set a specific role using an automation.

 

Thanks,

  Matteo

Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 17, 2024

That is the security level field, so the field name you are looking for is Security Level.

Like Matteo Gabanini likes this

@Mikael Sandberg

Not OP, but I am on a team-managed (next-gen) board, and when I try to set the Security Level field in the automation it gives me an error

Unknown fields set during edit, they may be unavailable for the project/type. Check your custom field configuration. Fields ignored -
Security Level (security)
Like Matteo Gabanini likes this
Matteo Gabanini July 24, 2024

@ヴァリエンテ フロリアン_Florian Valiente_ I have the same error. I'm sorry to not have update the thread before, I was on holiday and than I forgot this -.-

@Matteo GabaniniNo worries!

https://community.atlassian.com/t5/Jira-questions/How-can-i-set-issue-restriction-when-using-Jira-API-to-create-an/qaq-p/2487507 << I am currently trying to set it via the API, I will let you know if I am able to do it via the Automation HTTP Request

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events