Search for JIRA group usage in Workflows

Svante Gustafsson Björkegren
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 7, 2014

Hi all,

I am doing some heavy house-keeping in a quite messy JIRA instance. There are tons of groups created and one task is to get a grip on this and minimize the number of groups as much as possible and start using existing LDAP groups and Roles instead.

When viewing a group in the Admin GUI I get a good picture of the group's occurence in Permission Schemes, Issue Security Schemes, Notification Schemes and if any Saved Filters are using the group.

But I haven't found any information about the usage of groups in the Workflows. I did some poking around and found almost immediately a couple of transition validators using jira-groups. Ouch!!!

I guess this may be possible to dig out from the database in some way but I haven't found any tables holding the e.g. validator info.

Is there a way to query the database for a specific jira group name, say: jira-CAB-members?

Any suggestions are highly appreciated!

Cheers,

// Svante

1 answer

1 accepted

3 votes
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 7, 2014

The workflows are held mostly in xml in the database, so I'm afraid it's a case of searching rather large text fields. But not many of them

You could take a backup of the whole system in XML and explore it that way, but I doubt that's any cleaner than the SQL

However, in both cases, I wouldn't search for the groups - I'd go after the validators. The workflow stores it all in a way that says "for this validator, use class X, with parameters Y". So if you know what validator classes you have installed that might be using groups, you may find them a lot more quickly (this probably applies more to XML export and grep...)

Svante Gustafsson Björkegren
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 7, 2014

Great answer, Nic! Thanks!

I ended up doing it this way:

I ran the following SQL query to find all workflows using the validator in question

select workflowname, descriptor from jiraworkflows
where descriptor like '%com.atlassian.jira.workflow.condition.UserInGroupCondition%'
order by workflowname

This gave me a list of 15 workflows (of which half was backup-copies :-)

Each row held the entire XML descriptor for the workflow in concern so I just copied the value of that into my editor and searched for the validator. The location in the XML file gave me the transitions in question!

Now I just had to jump into the workflows and update the transitions in concern to not use the JIRA group anymore.

Much nicer approach than walk through 100+ workflows.

If I could I would upvote your anwser twice!

Cheers,

// Svante

G April 12, 2017

Hi Svante, I am facing the same issue we are renaming all exsisting jira groups i am looking for a query where i can check the groups usage could you please share the query to run in MSSQL 2012 could you please help me on this ?

 

Cheers,

Gopi

Suggest an answer

Log in or Sign up to answer