Script workflow function

Good-day, i have a script which works perfectly on a specified field but i want it to trigger with the associated issue number, this is the script i use:

((cfValues['Policy Number'] ?: 0) as Integer) >= 0

when i modify it this way it doesnt work:

((cfValues['Policy Number'] ?: 0) as Integer) >= 0.getValue(issue))

2 answers

1 accepted

This widget could not be displayed.
Mizan Community Champion Feb 25, 2013

OnDemand is the hosted service for Atlassian tools. You have used wrong tags in your question.

Your condition has syntax errors, you can try the condition tester provided by the script runner plugin.

Mizan, the script i used "((cfValues['Policy Number'] ?: 0) as Integer) >= 0" works perfectly but only thing i need help with is do i modify it to get the issue key?

Mizan Community Champion Feb 25, 2013

You should expiriment with the condition tester ,

The condition should be something like

if(issue.key='TST-123'){((cfValues['Policy Number'] ?: 0) as Integer) >= 0}

The above is not tested

I think what i need to do is customise email content becasue thats the out put i want. The condition is the way i did it?

This widget could not be displayed.

1. How are you running this script?

2. How are you doing it on OnDemand?

1. I am running it on workflow transitions "Script Post function"

2. Just add cript post function on a transition so that when policy number field is entered a vaule of moore than 0 it should fire an email which it does but i want it to include the ticket asscociated with it.


What "script post function"?

How are you doing this in OnDemand? The scripting plugins I've used are not available on OnDemand.

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted 8 hours ago in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

21 views 0 0
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you