Checkbox Scripting

Chris Negus November 9, 2014

Hi, I have created a checkbox field in Jira for which I have a set of values that will need to update different staff when selected. i.e.

Checkbox for 'Jira' is selected = Email comes to me

Checkbox for 'email' is selected = Email goes to someone else or group

I installed script runner for this and have been working all day to get the notifications sent but nothing goes through. Can you help and offer solutions to this issue?

 

Thanks

6 answers

1 vote
Peter Bengov
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 10, 2014

Is it a problem with email-sending or a problem with getting Script Runner to "catch" relevant field values?

0 votes
Chris Negus November 18, 2014

This is an example of what Im attempting to do. I enter the script in but the text shows up red, which would suggest to me that there is a missing link between the issue type and the condition? Thanks

JamieA
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 18, 2014

No,. that's just the syntax highlighting, which is showing that 'Bug' is a string literal. There is no problem there. There should be a preview button when you can test if the condition evaluated to true or false.

0 votes
Chris Negus November 18, 2014

2014-11-18 11_00_45-Update Workflow Transition Script Post-Function Function - Cambridge University .png

0 votes
Chris Negus November 12, 2014

Hi, Thanks for this. I had found this on another site but I added the values in brackets and they showed up red which I understood to be indicated a missing value?

JamieA
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 14, 2014

I don't really understand what you mean, or rather where you are adding these values, can you post a screenshot?

0 votes
JamieA
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 12, 2014

There's lots of different ways of doing this. Let's say you you have done it by creating a notification scheme with different events, where you are specifying the recipient.

Then you would have two Fire event post-functions (or listeners) with different conditions, which would fire the appropriate event. Condition would be defined like:

cfValues['Name of field']?.values.contains("Jira")
Domanin Vladimir Sergeevich December 7, 2016

Jamie, can you tell how take status(checked(true) or unchecked(false)) for this field ?

i'am mean, some like this: 

    if (name of field == true) ....

0 votes
Chris Negus November 10, 2014

I know our Jira email is setup correctly so im assuming that the issue is down to incorrect syntax? Thanks

Suggest an answer

Log in or Sign up to answer