groovy - JIRA CLI remove user from all roles for all project and remove user from watcher for all issues -


using jira cli, there way remove user project roles issue listed watcher as? doing manually each project extremely time consuming , prone error. cli examples @ https://bobswift.atlassian.net/wiki/display/jcli/examples looks watcher can removed on issue issue basis (using removewatchers command) , project role actors can removed on per project , role project basis (using removeprojectroleactors command).

i prefer solution cli command, groovy script acceptable well. if @ possible, prefer not manually remove data database. appreciated not finding in way of accomplishing via cli.

while there no dedicated actions you're talking about, it's popular combine actions runfrom[whatever] actions in order perform them in bulk.

cleaning watches can done in 1 line using runfromissuelist action. example be:

jira --action runfromissuelist --jql "watcher = username" --common "--action removewatchers --issue @issue@ --userid username" 

role clean-up more complicated, still faster doing directly within jira ui. there 2 jira cli commands run overall, bunch of stuff in between them:

jira --action getprojectrolebyuserlist --userid username --file rolelist.csv  // action can take long time finish - else while // edit heck out of csv prepare next step  jira --action runfromcsv --file rolelist_edited.csv --common "--action removeprojectroleactors --userid username" 

the csv you'll first command have 1 row per project , 1 column per project role. values yes/no based on user's permissions. you'll have massage yes values new 2 column table [project] [role] headers, 1 row every yes in original table.

if user in lot of roles across lot of projects , feels overwhelming, internet search "unpivot" , name of spreadsheet editor, , might find shortcuts.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -