Forums

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

Scriptruner: how to get project lead in workflow condition with an expression?

Charlie Misonne
Community Champion
November 2, 2021

Hi Atlassian Community!

I wonder how I can get the project lead of an issue in a workflow condition with scriptrunner. I know scriptrunner only supports expressions and no API calls in conditions in Jira Cloud.
But I'm unable to fetch the project lead. My goal is to only allow a certain transition by the project lead.

I tried this and other variants but none of them work

user.accountId == project.lead.accountId

Any help is appreciated! 

3 answers

1 accepted

3 votes
Answer accepted
Tansu Akdeniz
Community Champion
November 2, 2021

Hi @Charlie Misonne 

It seems that "lead" property is not supported in expressions. And there is no way shown in doc.

Charlie Misonne
Community Champion
November 2, 2021

Thanks for your answer. Indeed it's not in the docs so I'm hoping someone in the Community has a workaround.

I simply want to restrict a transition for the project lead. Sounds easy but on Cloud it's not...

Charlie Misonne
Community Champion
November 2, 2021

I'm going to try it with JMWE instead

David Fischer
Community Champion
November 2, 2021

@Charlie Misonne it won't work either, since JMWE, just like ScriptRunner and any other Cloud app, can only use Jira Expressions for Conditions and Validators.

Charlie Misonne
Community Champion
November 2, 2021

Right thanks for pointing that out David. I had Jira server in mind again.

Found a feature request for the project lead condition JRACLOUD-10793 More than 15 years so it's not very promising...

For the expression I didn't find any feature request yet. Any idea if this should be created in ecosystem.atlassian.net or jira.atlassian.net ?

David Fischer
Community Champion
November 2, 2021

It should be created on ecosystem.atlassian.net, in the ACJIRA project, "Jira Expressions" component.

Charlie Misonne
Community Champion
November 3, 2021

Ok I created tis improvement request: ACJIRA-2493 

Let's vote! :-)

1 vote
Bert Dombrecht
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.
July 11, 2023

A bit late to the party :-)
But I was looking for the same thing.
I found this worked as a Validator:

user.getProjectRoles(project).map(p => p.name).includes("Project Lead")

Charlie Misonne
Community Champion
July 12, 2023

Hi Bert,

Thanks for bringing this topic back up.

In the meantime my feature request has been resolved and the project lead is available via expressions according to the documentation.

https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference/#project

I haven't tested it to be honest.

Like Bert Dombrecht likes this
0 votes
Joshua Sneed Contegix
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.
November 2, 2021
Charlie Misonne
Community Champion
November 2, 2021

Hi Joshua,

Thanks for your answer but that post applies for Jira server and the Jira Cloud scripts are totally different.

Suggest an answer

Log in or Sign up to answer