Forums

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

How to make field user picker form issue to be permissian condition for move link issue field

Tyas Iglecias December 8, 2021

Hi Guys,


I have 2 issuetype, Story and bugs

I used field IT Problem Manager (user picker (multiple users)) in story,

than I linked Story to Bugs.

What I want, issue bugs can move status by users in field IT Problem Manager 

 

I make script in JMWE in workflow Bugs

user.displayName == linkedIssue.customfield_12441[0].displayName

 

test results : 

- Scenario 1 :

if I input user A in field IT Problem Manager in story

user A can move status in issue bugs, and user B can't move status

 

- Scenario 2 :

if I input user A an user B in field IT Problem Manager in story

user A or user B can't move status in issue bugs

 

what I want make script to make Scenario 2 work used (user picker (multiple users)) from linked issue 

 

what should I do?

 

 

Regards,
Tyas - CIT

 

 

 

 

 

1 answer

1 accepted

0 votes
Answer accepted
Bastian Stehmann
Community Champion
December 8, 2021

Hi @Tyas Iglecias ,

I think the problem is that you are checking for equaltiy, so the username must match the content of the field.

Assuming that linkedIssue.customfield_12441[0].displayName returns a String containing both user Names,  you can try something like this (I couldn't test it currently)

linkedIssue.customfield_12441[0].displayName.matches("(.*)"+user.displayName+"(.*)")

This checks, if the String returned from the field contains the Display Name.

Tyas Iglecias December 8, 2021

Hi @Bastian Stehmann 

 

thanks for your help

I tried the script, but it doesn't work

error1.JPG

 

please check my configuration, is somethink I missed?

 

Regards,
Tyas

Bastian Stehmann
Community Champion
December 9, 2021

Hy Tias,

 

sorry for the delay, I had now some time to try myself.

I think, we need another approach here. Can you try this one:

 

linkedIssue.customfield_10029
.filter(u => u.displayName == user.displayName)
.length > 0

Like Tyas Iglecias likes this
Tyas Iglecias December 10, 2021

Hi @Bastian Stehmann ,


Thanks for help, its work!

is there a reference I can read to be able to make a script like yours?

 

Regards,
Tyas

Bastian Stehmann
Community Champion
December 10, 2021

You're welcome. I'm working with this documentation.

https://developer.atlassian.com/cloud/jira/platform/jira-expressions/

Like Tyas Iglecias likes this

Suggest an answer

Log in or Sign up to answer