Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,360,196
Community Members
 
Community Events
168
Community Groups

scriptrunner for jira cloud illegal character error

I'm at my wits end.  I've been fighting this all morning and can't figure it out.  I'm getting the following error.  For what it's worth, it works like a charm in the script console!

2019-08-30 16:09:07.529 ERROR - java.net.URISyntaxException: Illegal character in path at index 90: https://avst.connect.adaptavist.com/proxy-service/rest/api/1/jira/proxy/rest/api/2/issue/${issue.key}
2019-08-30 16:09:07.531 ERROR - Class: com.adaptavist.sr.cloud.workflow.RunScript, Config: [className:com.adaptavist.sr.cloud.workflow.RunScript, uuid:c8514b86-b940-4843-97bd-b79eebd340b8, description:devChange calculation, enabled:true, executionUser:ADD_ON, additionalCode:// get custom fields

My script fires on a workflow transition:

def customFieldName = 'customfield_13635'

def result = get("/rest/api/2/issue/${issue.key}?fields=${customFieldName}")
.header('Content-Type', 'application/json')
.asObject(Map)
def currentValue = result.body.fields[customFieldName] as Integer
def newValue = currentValue + 1

def newResult = put("/rest/api/2/issue/${issue.key}")
.queryString("overrideScreenSecurity", Boolean.TRUE)
.header('Content-Type', 'application/json')
.body([
fields:[
customfield_13635: newValue
]
])
.asString()

2 answers

Hi,

I am getting the same error of the first message. Any additional info about how to solve it?

Thank you

Nevermind.  I figured it out.  :-)

Hi Mary,

Thank you for confirming that you managed to resolve your issue. 

Could I please ask you to share here the details of what you did to resolve the error, so that other users with the same error can see how to resolve it. 

Regards,

Kristian

Suggest an answer

Log in or Sign up to answer