You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hi there,
I have an API call that creates Objects in Assets, but it is fundamentally failing when it gets to a record like this;
first.lastname_AndroidEnterprise_8/1/2022_12:30 AM
This is running from Powershell and a PSCustomObject is made, turned into JSON and then sent over. It works fine except for messy lines like above.
The error looks like this;
Invoke-RestMethod : {"errorMessages":["AQL \"Name = first.lastname_AndroidEnterprise_10/21/2022_4:11 AM\" has invalid syntax at position 11 with error message \"mismatched input '.' expecting {, ' '}\""],"errors":{}}
I have tried a little function to try and encode the line
function FixDeviceName($IncorrectName) {
$encodedFileName = [System.Uri]::EscapeDataString($IncorrectName)
return $encodedFileName
}
but then I end up with all extra characters in the name which is going to cause other issues.
Does anyone have any ideas about what I can do to get a variable with so many special characters into a format that can be used as part of a POST to Assets.
Thanks