Bulk change Security Level

Jennifer D. Smith May 3, 2022

I need to set Security Level for over 100,000 issues. Bulk change 1000 at a time or Jira Automation constantly timing out are both terrible. It seems like I ought to be able to run larger batches via Jira CLI, but I can't get it to recognize the Security Level field by name or id (security).

Some commands I've tried (also variations with and without single and double quotes):

acli --action runFromIssueList --jql "project = CAPS AND 'Localization Help' is EMPTY" --common "--action setFieldValue --issue @issue@ --field security --value 10602"
acli --action runFromIssueList --jql "project = CAPS AND 'Localization Help' is EMPTY" --common "--action setFieldValue --issue @issue@ --field 'Security Level' --value Internal" 

 I always get an error that the custom field "is not defined or not valid in this context." I think this might be because I'm on Jira 8.22 and Security Level is a system field? Anyone know how to get this to work?

2 answers

2 accepted

1 vote
Answer accepted
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 3, 2022

I have not checked this recently, but I wanted to get you an answer as fast as possible!

Last time I tried to set the Security level over REST, the field name/id was "level", not security or security-level - could you give that a quick shot?

The other thing to look at is if the account posting the security level is a part of it - only users in a level can apply it to an issue.

Hannes Obweger - JXL for Jira
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
May 4, 2022

Hi @Jennifer D. Smith @Nic Brough -Adaptavist-

I just had a look at our REST calls and I believe the field name is indeed security. However, the value is passed as "{ "id": "<id-value>" }, see below:

Screen Shot 2022-05-04 at 2.15.21 pm.pngPerhaps that is needed in the CLI, too? 

Like Jennifer D. Smith likes this
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 4, 2022

Thanks for looking that up for us!

The id would make sense - the REST call expects the id of the security level, not the name!

0 votes
Answer accepted
Jennifer D. Smith May 10, 2022

Thanks to some hints I got from the API info from Nick and Hannes, this is the working Jira CLI call:

acli --action runFromIssueList --jql "project = CAPS AND 'Localization Help' is EMPTY" --common "--action setFieldValue --issue @issue@ --field security --value Internal --suppressNotify" --continue

 

Important: make sure that your CLI user's permissions are correct and also that the field is on the edit screen for the issue types that you are looking to change. 

Suggest an answer

Log in or Sign up to answer