Hi Team,
I'm trying to achieve following using script runner.
Based on values provided or selected in one field, need to call rest service to fetch data from external APIs, which will return following response in format.
{
"ac": "string",
"acCode": "string",
"acTime": 0,
"cItDTO": {
"coverageId": "string",
"date": "2021-10-03T05:37:02.252Z",
},
"comments": "string",
"currencyCode": "string",
"exchangeRate": 0,
"itDescription": "string",
"itMfgDTO": {
"it": "string",
"mfgCode": "string",
"mfg": "string",
"vendorDTO": {
"vendorCode": "string",
"vendorName": "string"
}
},
"line": "string",
"location": "string",
"pnDTO": {
"averageCost": "string",
"commodity": "string",
"Description": "string"
},
"quantity": "string",
"quotePrice": "string",
"trx": "string",
"trxDate": "2021-10-03",
"uqDTO": {
"Id": "string",
"description": "string",
"type": "string"
}
}
Need to populate all these values to various fields.
So far i worked on single field population only but no idea to handle multiple field values from json and pass it back to server side script or behaviour script to populate multiple fields in that issue screen.
Got the solution. have written server side script for behaviour.
Thanks for your support.
Hi @Ash
I might have misinterpreted your question but, once you get this response from external API you can populate as many fields as you can using the response.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Tuncay for your response.
the concern here is, how to call rest end point from server side script and get the response to set values in various fields. my all fields are single line text box only.
and i don't need to convert any field into multi select.
So it's like that:
1. select a value in field 'A'
2. through server side script on field 'A' call rest end point and get the json.
3. parse json and populate values in various fields like x, y , z
So my Main concern is step#2 - how to call service from server side and get response.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.