.

Raynard Rhodes November 23, 2020

.

1 answer

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 23, 2020

Look closely at what you are doing with JiraIssueList - you get its content and split it as though it is a string.  Is it really a text field with a list of issue keys in it?  Do you actually trust your humans to get the format right every time?

Assuming it is a valid list like that, then think of the text in it - it's an issue key.  So when you cast it to a mutableissue, the result is utter nonsense - an issue is not a string of characters.

Your log will tell you that line is nonsense whenever it executes, and because it is, the script will stop at that point.

Step back and look at the actual type of field 10083 is - is it really a string?  Or is it a select list or issue picker?  Once you know what type of data is really in it, you can parse it and use that data to find the issue it is pointing to.

Raynard Rhodes November 23, 2020

The custom field is a Text-Field (multi-line), which is a string.

Changing

def jiraIssue = removeComma.replaceAll(","," ") as MutableIssue

to

MutableIssue jiraIssue = removeComma.replaceAll(","," ")

I get an error Cannot assign value of java.lang.String to MutableIssue.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 23, 2020

Yes, that's what I said - you can't just cast an arbitrary string to an issue.

Your code needs to work out what issue the string is pointing to (if that is a valid pointer - you really do need to check that the string is actually valid, as a human could be putting anything into it)

Suggest an answer

Log in or Sign up to answer