Scriptrunner condition on assignee

Jason Friedman
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 24, 2015

I was able to set the Assignee to "John" via Scriptrunner.

My next step is to set the Assignee to "John", but only if the Assignee field was left as Automatic by the user.  If the user enters or selects a specific user for the Assignee field I want to honor that.  This does not work:

issue.get("Assignee")=="Automatic"

It is true I could use the Component lead for a similar effect, but this particular project does not use components.

5 answers

1 vote
Darren Pegg
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 24, 2015

Still use components.. Just make one up and hide from the create/edit/view screens?

Just pop on the description.. " leave this alone or else....." smile

(Saves maintaining scripts - But it cannot be re-used on a project that uses components)

So maybe not so much of a good idea..

Is this on Create transtion, instead of having it at the top of the post transition list pop it in after so it realises the field has automatic in it..

0 votes
Jason Friedman
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 29, 2015

I ended up setting the project's lead to "John" and hiding the components field.

0 votes
Darren Pegg
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 24, 2015

Testing this myself, I'm indeed stuck!

0 votes
Darren Pegg
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 24, 2015

No problem buddy,

I'm guessing you have tried 'before' and 'after' the create issue function?

Place a reindex post function in there also, then put the script in post the re-index..

Trial and error, but should work as long it thinks 1st "Automatic" has already populated the field.. :-/

 

 

 

 

0 votes
Jason Friedman
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 24, 2015

Hidden component not a bad idea, I will consider it.

Putting it on the bottom had no effect.

Suggest an answer

Log in or Sign up to answer