Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to remove the <p><p/> that added after Copy Value From Other Field (JSU)

kahn chang November 5, 2018

Copy Value From Other Field (JSU) Issue Relation: Source and destination issue are the same.Copy Field:  Time  to TXT , append with separator: ,open

 

Output TXT field

<p>,open2018-11-08 00:00:00.0</p>

2 answers

1 vote
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 5, 2018

The app simply copies what is in the source field into the destination.  The text in the source field contains the extra text, so it gets copied.

0 votes
kahn chang November 5, 2018

thanks Nic

I trim string with ScriptRunner

import com.atlassian.jira.component.ComponentAccessor

def customFieldManager = ComponentAccessor.getCustomFieldManager()
def PointCf = customFieldManager.getCustomFieldObjectByName("Point")

def Point = (issue.getCustomFieldValue(PointCf) as String)?.replaceAll("<p>|</p>","")
issue.setCustomFieldValue(PointCf, Point)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events