Role Strategy Plugin - how to apply multiple patterns in project roles

Skip to first unread message

Jan Seidel

Oct 11, 2013, 7:25:08 AM10/11/13

Hi folks,

I am setting up Role Strategy as too many people can peek and poke in too many jobs and mess around.
We have many build jobs which leads me to a problem when assigning Roles in Projects roles.

I need multiple patterns for a single role if possible.
e.g. the role MIB admin must access all jobs starting with (?i)RB_MIB.*, (?i)HMI_MIB.* and (?i)JXE_MIB.* but not (?i)MB_GUIDE_MIB.* nor any other job that is outside of the scope of this project.
So simply taking (?i).*MIB.* won't work.

Is it possible to use multiple patterns for one role and if yes, how?


Daniel Beck

Oct 11, 2013, 7:35:12 AM10/11/13
There's no way to define multiple patterns for a given role (which would enable different permissions depending on the job for the same role).

But the pattern '(RB|HMI|JXE)_MIB.*' should do it. Maybe look up the java.util.regex.Pattern docs?
> --
> You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
> For more options, visit

Maneesh M P

Oct 15, 2013, 4:25:17 PM10/15/13
You can do with piping I guess

(?i)RB_MIB.* | (?i)HMI_MIB.*  | (?i)JXE_MIB.*



Mar 22, 2019, 6:02:32 AM3/22/19
to Jenkins Users
Maneesh thanks for the reference.


the following worked for me


where job{a..n} are the job names.

Rob C

May 12, 2022, 4:19:28 PMMay 12
to Jenkins Users
I'm replying because this thread is a very high result on google searches.
You can enter a string such as this into the "Pattern" field to allow a single role to apply multiple prefix patterns


Or if you want to match on the middle of a job name you can do something like this


Reply all
Reply to author
0 new messages