Danny,
This is a known issue with the REST API for which Micro Focus does have an existing Enhancement Request. For now, you could do something quick like renaming the problem attachments. Since identifying and renaming them manually would likely be a pain, you could implement some workflow code or OTA code to do the trick. Since it appears you are on a SaaS instance, I believe you or your admin should have access to the workflow customization for the Project. If I were in this situation, I would simply implement a toolbar button in the defects module that goes through the list of attachments on each defect, and then examines the name of each attachment, produce a clean filename if special characters are detected, then rename the attachment with that clean filename.
I have written some code to do just that. This code comes with no warranty, so use it at your own risk. Place it in the workflow for the project in question and it will rename the attachments for you. There are some message boxes that slow it down currently, but you could strip those out once you have vetted the code in a test project.
You will need to know a little about how to implement a toolbar button on the defect toolbar, I am not going to explain all that here. It is fairly straightforward in the workflow script editor. My workflow toolbar button is tied to an action called ''UserDefinedActions.Defects_Action1''. You'll see that in the code below. I simply have an if statement in the ActionCanExecute Function in the workflow that triggers my code to run. My code also calls another function called ''CleanString''. Just place it anywhere outside the other workflow functions. There are some comments, but be sure to try it in a test project first so that you are sure you know exactly what it is doing.
Function CleanString(strInput)
'create regular expression object
set re = new regexp
'set the pattern to match: characters that look like plus sign (U+002B)
'and some other examples like forward slashes (solidus [U+002F], fraction slash [U+2044], and division slash [U+2215])
' add any other characters identified as problematic here in the 're.Pattern' to clean them from the attachment filenames
' it is 'a pipe delimited list of characters to look for in the regex
re.Pattern = ''(u002B|u002F|u2044|u2215)''
re.IgnoreCase = True
'match all instances found
re.Global = True
' replace all found bad characters with an underscore
CleanString = re.Replace(strInput, ''_'')
'free memory
set re = nothing
End Function
Function ActionCanExecute(ActionName)
if ActionName=''UserDefinedActions.Defects_Action1'' Then
'msgbox ActionName
Dim attachFact
Dim theAttachment
Dim attachList
Dim BugFact
Dim tdc
Dim theBugList
Dim Actions
Dim Bug
Dim Attachment
Dim AttachmentFilter
Dim cleanFileName
Set tdc = TDConnection
Set BugFact = tdc.BugFactory
Set theBugList = BugFact.NewList('''')
For Each Bug In theBugList
Set attachFact = Bug.Attachments
Set attachList = attachFact.NewList('''')
For Each theAttachment In attachList
cleanFileName=CleanString(theAttachment.Name)
if StrComp(cleanFileName,theAttachment.Name,0) = 0 Then
msgbox ''Original Filename'' & vbCrLf & theAttachment.Name _
& vbCrLf & vbCrLf & ''New Clean FileName'' & vbCrLf & cleanFileName _
& vbCrLf & vbCrLf & ''MATCH, NO CHANGE NEEDED''
else
msgbox ''Original Filename'' & vbCrLf & theAttachment.Name _
& vbCrLf & vbCrLf & ''New Clean FileName'' & vbCrLf & cleanFileName _
& vbCrLf & vbCrLf &