JIRA CLI CopyValue and appendText

Antonio D'Errico December 21, 2015

Hello Experts,

i have two customfields:

MR as Single Line Text

and

MRS as Multi Line Text.

No i want to move all text from MR to MRS.

The problem is that several issues already have text in MRS and i do not want to overwrite them.

I tried the JIRA cli which i believe can work:

java -jar `dirname $0`/lib/jira-cli-3.9.0.jar --server JIRAURL --user xx --password xxx --issue "XXX-1" --action copyFieldValue --appendText --field "Merge Request" --field2 "Merge Requests"

But i want a line break before the text from MR to MRS will be copied.

 

At the moment this is the result:

https://jira.dehttps://appendedtext

 

But i want it like this:

https://jira.de

https://appendedtext

 

 

1 answer

1 accepted

0 votes
Answer accepted
Bob Swift OSS (Bob Swift Atlassian Apps)
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.
December 21, 2015

I haven't tried this, but, this might work. First use setFieldValue on the target field and append text using --value " \n " (the spaces are important). Then do the action you did before. 

Antonio D'Errico December 21, 2015

now it looks like this :-< https://jira.de\n java -jar `dirname $0`/lib/jira-cli-3.9.0.jar --server JIRAURL --user xxx --password xxx --issue "xxx" --action setFieldValue --appendText --value " \n " --field "Merge Requests"

Bob Swift OSS (Bob Swift Atlassian Apps)
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.
December 22, 2015

Unfortunate :(. Looks like we aren't converting that value field like we do for some other text fields. Sorry, I don't have any other suggestions.

Bob Swift OSS (Bob Swift Atlassian Apps)
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.
December 22, 2015

I suspect this use case could be handled with setFieldValue once JCLI-742 gets implemented.

Suggest an answer

Log in or Sign up to answer