Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,559,022
Community Members
 
Community Events
184
Community Groups

Make Portfolio Team field mandatory based on Workflow state (with ScriptRunner)

Hello

I need help!! Getting crazy with this:

We have JIRA Server and ScriptRunner, and we are using JIRA Portfolio.

I want to enforce that the Team field (customField) becomes mandatory whenever a user transitions a ticket from Open to something else. So, I tried to setup a Simple scripted validator with ScriptRunner in the transitions of our workflow.

My code is:

import com.atlassian.jira.component.ComponentAccessor
import com.opensymphony.workflow.InvalidInputException
def cfm = ComponentAccessor.customFieldManager
def val = cfm.getCustomFieldObject('customfield_12300')
if (issue.getStatus() != "Open" && issue.getCustomFieldValue(val) == "") {
throw new InvalidInputException("customfield_12300",
"The Team field must be set to continue.")
}

image2016-3-10 17_17_16.pngHowever, as I result, I get an general workflow error message when I transition this ticket (independent of the value of the Team field.

Thanks in advance,
Marco

1 answer

Hi Marco,

Could you get around this problem?

Kind Regards,

Marc

Not really. But we use ScriptRunner Behaviours as a workaround. The Team is mandatory now (for some of our users) independent of the workflow stage.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events