Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Compatibility Scriptrunner and ProFields

Hello,
I a using a Simple Script Validator in a workflow to request a mandatory field (Story Points) depending of a Profields value as well (Field called "Project Methodology")
I am not sure that Scriptrunner is compatible with Profields because I can't make it work. Or maybe I miss something.
I want the error message in transition IF my project is AGILE AND Story Points is empty
Here is the condition I am using: 
"cfValues['Project Methodology'] != 'AGILE' || cfValues['Story Points'] != null"

I tried with Custom Fields Ids as well with no success. ProField is creating their fields as custom fields so I was pretty sure to be able to use them. Thanks for your help.
Romain

1 answer

0 votes

I suspect they're compatible, but the code is not handling it.

When you ask JIRA for the value of a field in Java, you have to make sure you code for the right return value.  A field might hand back a string, a number, a date/time, an option (select list value), a user, or arrays of things when it's a multi-select.  If you try to use a variable of the wrong type to hold a field value, it falls over.  The Groovy that Scriptrunner uses does not fall over, it just carries the returned object, whatever the type.

The first part of your condition in English is "Whatever the object is in that field, try to convert it to a string and compare it with the string 'AGILE'"

I suspect that the Profields value being returned is not something that can be converted into a string automatically by Groovy.

You should still be able to make it work, but it's going to need some investigation to see what is really being passed back.

Thank you @Nic Brough _Adaptavist_, it's a good clue. 

My Profields Field is a Profields Select List so it's not really a Text value with property value. But when I try to use another property like "?.value" or "*.value" it doesn't work neither. 

The customfield from Profields has a type "Profields Custom Field List" and not "Select List" as usual. So I don't know why java class I can use to get the value of this type.

That's what would need to be investigated - what class comes back and how to get the data you want out of it.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase

The benefits of using Jira in different departments

Jira is a great tool to use across different departments. Forget that paperwork – switch to Jira and get that tasks done smoothly. Marketing Jira allows for a complete digital transformation of you...

52 views 0 2
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you