Is there a way to copy a field (i.e. the Summary) during a rule to create a new issue WITHOUT encountering this error:
The summary is invalid because it contains newline characters. (summary)
Hi Paula,
Yes, you should be able to do that. What exactly are you trying to do? Or can you share the rule that you have so far?
The rule creates a related issue and sets the summary and description by copying from the parent issue and, for the summary, appends:
{{issue.summary}} Access [Security KnowBe4+Git+AWS]
I need to strip the newline from the Summary before it is copied to avoid the error.
Hi @Paula Manildi
I wonder how the newline got on your summary. Doing this should remove it:
{{issue.summary.trim()}}
Best regards,
Bill
I have a solution for this: use {{issue.summary.replaceAll("\n", "")}} to remove all newline characters ("\n") instead of {{issue.summary}}.
Hi, i've tried your method {{issue.summary.replaceAll("\n", "")}} , but in one case i got an issue on " is invalid because it contains newline characters"
on "lorem p\n ipsum" input text (p\n is aka Part number)
May be you have any insights and ideas?
Hi @kon
Can you clarify your case further? are you cloning an issue and the content "lorem p\n ipsum" is from the summary of the source issue?
Hi, Phong, actually my rule is for description field (but i think idea is same as with summary)
i am copying part of description to summary and want copy without line breaks (otherwise summary will not take it)
{"fields": {"summary": "{{issue.description.abbreviate(254).replaceAll("\n", " ")}}" }}
in most cases it works well, except of when user entered p\n to description "lorem p\n ipsum"
It looks like you're new here. Sign in or register to get started.