Forums

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

getting error while accessing key value from the json data in script runner confluence

Sushma
September 12, 2019

Hi Team

I am trying to retrieve the key values from the JSON data in the confluence script runner.

but i am getting the below error.

groovy.json.JsonException: expecting '}' or ',' but got current char 's' with an int value of 115 The current character read is 's' with an int value of 115 expecting '}' or ',' but got current char 's' with an int value of 115 line number 9 index number 217 "value": "<at:declarations /><ac:structured-macro ac:name="section" ac:schema-version="1" ac:macro-id="8d7755f6-be87-4926-80d6-9561a0002bf0"><ac:rich-text-body><p><ac:task-list> .......................................................................^ at Script229.run(Script229.groovy:71)

 

Anyone please help me to resolve this.

Regards

Sushma

1 answer

Suggest an answer

Log in or Sign up to answer
0 votes
Goetz Eichholz
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!
March 17, 2021

Hi Jens,

try to correct the service xml configuration:

<importcsvservice id="importcsvservice">
<description>Dieser Dienst importiert Sollzeiten für den Multi-Timetracker</description>
<properties>
<key>input-file</key>
<name>admin.service.fileimport.sourcefile</name>
<type>string</type>
</properties>
</importcsvservice>

to the following one (you missed the property element):

<importcsvservice id="importcsvservice">
<description>Dieser Dienst importiert Sollzeiten für den Multi-Timetracker</description>
<properties>
<property>
<key>input-file</key>
<name>admin.service.fileimport.sourcefile</name>
<type>string</type>
</property>
</properties>
</importcsvservice>

and properties can be easily accessed in the init method
public void init(PropertySet props) throws ObjectConfigurationException {
......
}
Regards Götz

Jens Kisters __SeibertSolutions
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 Champions.
March 17, 2021

Thanks for your answer, unfortunately im not working on this project any more and can't try this out (the jira instance doesnt exist any more)

TAGS
AUG Leaders

Atlassian Community Events