Forums

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

Why my code is underlined in scriptrunner (API POST)

YannRamirez
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 18, 2020

Hi,

I am new to scriptrunner and I do not understand why the code is underlined when I define the header of my POST request.

Thanking you in advance.

groovy.PNG

1 answer

1 vote
Nic Brough -Adaptavist-
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.
September 18, 2020

It is often the case that errors later in the file are caused by earlier ones, so generally you want to work top-to-bottom.

The problem with your first three lines is the same - each one starts with the name of a variable that you have not yet defined.  The code can't know what they are.

You might want to simply stick "def" in front of them, so they change from "unknown thing X should be set to a copy of the contents of Y" to "create an object X which contains a copy of the contents of Y"

Suggest an answer

Log in or Sign up to answer