This article explains how to set the scope of a filter in Jira to either Global or Private using Jira Command Line Interface (CLI).
...
Before creating a filter in Jira, set the scope of the filter using the action setShareScope as given in the below example.
Code Block theme Midnight --action setShareScope --value Global
The above action defaults the filter share scope for the current user to GLOBAL.
Create a filter using createFilter action as given in the below example:
Code Block theme Midnight --action createFilter --name filterforTSboard --jql "project = TESTER01 ORDER BY Rank ASC"
The above action creates a filter named "filterforTSboard" for the Jira project "TESTER01".
- To verify the filter permissions from Jira UI, follow the below instructions:
- Log in to Jira as an administrator.
- From the top navigation bar, click on Issues.
- From the dropdown select Manage filters option, as shown in the screenshot below:
- As the below screenshot indicates, the filter "filterforTSboard" has no restrictions and can be viewed by any logged-in user.
Similarly, the filters can be restricted by setting the scope to "PRIVATE". Refer to the sample action given below for the same.
Code Block theme Midnight --action setShareScope --value private
Code Block theme Midnight --action createFilter --name filterforTSboard-1 --jql "project = TESTER01 ORDER BY Rank ASC"
- The filter "filterforTSboard-1" is set as Private in Jira as shown in the below screenshot:
Info |
---|
Please note that the filter scope can only be applied during filter creation but not while updating. Hence setShareScope doesn't set the filter scope when performing updateFilter CLI action. |
Info |
---|
It is recommended to test this scenario in a non-production environment, or, run the action with the --simulate parameter to verify the behavior before deploying. |
...