08/25/2023 06:35 AM
Can someone please provide a syntax to split an entitlement value by Tilde and send the first token it in a REST URL.
Entitlement Value : IGA~admin
Instead of sending the entire entitlementValue, I need to pass only "IGA" by splitting the string by ~ and sending the first token.
{
"name": "Team",
"connection": "acctAuth",
"url": https://api.github.com/orgs/${entitlementValue}/memberships/${account.name},
08/26/2023 01:36 AM
Try with below one
"https://api.github.com/orgs/${String ev=entitlementValue;String[] evArray=ev.split(\"~\");return java.net.URLEncoder.encode(evArray[0],java.nio.charset.StandardCharsets.UTF_8.toString())}/memberships/${account.name}"
Thanks,
Hemanath J
If this reply answered your question, please Accept it As Solution to help others who may have a similar problem.
08/29/2023 08:36 AM
Hi @RV ,
You can try the below sample :
${entitlementValue.entitlement_value.substring(0,entitlementValue.entitlement_value.indexOf('~'))}
Hope this helps !