Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Error in my groovy script (custom listener to update subtasks fields from parent's)

Camille Lecerf
Contributor
June 19, 2018

Hi,

I am trying to use your groovy script for my listener
Could you help me with this error please ? 
GroovyScriptListenerUpdateFields.png Thank you in advance,

Camille

2 answers

1 accepted

0 votes
Answer accepted
Mark Markov
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.
June 19, 2018

Hello @Camille Lecerf

The problem is that you pass Issue object as parameter, but your function need MutableIssue.

You can cast object

syncCustomFieldvalue(((MutableIssue) event.issue), ((MutableIssue) it), change.field as String )
Camille Lecerf
Contributor
June 19, 2018

Thanks Mark, yet there's still a problem :(

error2.png

Mark Markov
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.
June 19, 2018

you have copy my code with mistake :)

value starts with lowercase. fix it and it should work!  

syncCustomFieldValue
Camille Lecerf
Contributor
June 27, 2018

Thank you, this worked !

Regards,

Camille

0 votes
Alexey Matveev
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.
June 19, 2018

Hello,

try to write 

syncCustomFieldValue(event.issue, it, change.field as String)

Camille Lecerf
Contributor
June 19, 2018

Thank you but sorry I think there's an other problem

error1.png

Alexey Matveev
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.
June 19, 2018

syncCustomFieldValue(event.issue as MutableIssue, it as MutableIssue, change.field as String)

Suggest an answer

Log in or Sign up to answer