Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Custom JQL function: membersOfProjectRole

Yves Martin
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 Champions.
February 1, 2018

  Hello

I am looking for a way to test "assignee in membersOfProjectRole(PROJECTKEY)" as standard "membersOf" is restricted to JIRA groups.

I have found a pending request: https://jira.atlassian.com/browse/JRASERVER-21711

And some example code at https://mraddon.blog/2016/02/17/jql-custom-function-userinrole-with-groovy-for-jira/ and https://mraddon.blog/2017/01/03/lastcommentcontains-jql-function-for-jira-7-2-scriptrunner/

May you please provide updated code of this function for JIRA 7.6/7.7 ?

@Adaptavist SuppWould it be possible for this JQL function to be included in plugin itself ?

Thank you in advance for your help

1 answer

Suggest an answer

Log in or Sign up to answer
0 votes
Alex
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 Champions.
May 16, 2022

Hi @Shah Baloch 

How do you plan to implement that using a post-function or a listener to trigger at the create issue event?

Cheers 

Alex 

Shah Baloch
Contributor
May 16, 2022

I would like to have it in the initial stage like when the issue is created it should have the email address in the email field. 

Shah Baloch
Contributor
May 17, 2022

I was able to make it works with a behaviour script by mapping manually users' names with their emails. The problem is someone needs to maintain the script when there will addition and deletion of a user. I mean have to maintain the script when need to remove or add a member. I was looking if there will be an easy way to not maintain the script all the time?

def optionsConMap = [
   'User Name': 'user@email.com',
     'Some User': 'some@email.com'
]

def option = getFieldById('customfield_10519').value
def emailAddr = optionsConMap[option]
getFieldById('customfield_10520').setFormValue(emailAddr)

def email = getFieldById('customfield_10520')
email.setHidden(true)

 

Thank you for your help

TAGS
AUG Leaders

Atlassian Community Events