Setting specific custom field values with JIRA Clone Plus plugin

Hi all,

Can anyone provide an example of using the Clone Plus plugin to set a custom field to a specific value when copying an issue? This is with CP 1.3.1 on JIRA 4.4.5, and I'm using the standard "Clone+" operation.

I've read the documentation (which seems rather cryptic) and it hasn't given me any clues. My latest attempts look like the block below. The field in question is number 10204, which is named <fieldname>, and it's a Number field. My goal is to have this field set to -1 whenever an issue is cloned.

fieldIncludes = customfield_10204

No matter what I try in the file, the target issue always receives an empty value for the specified custom field.

Any pointers to the correct syntax would be appreciated!


1 answer

1 accepted

1 vote
Accepted answer
You need a custom clone operation to set field values.
  1. How to use clone properties for customization explains how to enable a custom clone operation. For instance, say the Clone+ (custom 1)
  2. Eidt your and add something like
    1.set.customfield_10204 = -1
    1.set.&lt;fieldname&gt; = -1
  3. Disable and enable the plugin to have your property changes become active.

With that in mind, if we are not going to be able to make the custom clone work without modifying the screens, is there then any possibility of having the semantics of "fieldExcludes" updated to use a field's default value (if any) rather than simply setting it to null? That would allow us to clone the issue without needing to resort to a custom clone operation in the first place.



Thanks for your note. The tip to using the "custom clone" operations was helpful. (As a side note, I couldn't find anywhere in the documentation that this is spelled out. Unless I missed it, it might be helpful for other users if to add something to the introduction page which explains why you might need to use a custom clone operation versus a standard clone plus, and to emphasize that the default clone operations cannot be modified.)

Having written that, I am still unable to get it to work in our scenario. Here is what my configuration looks like now:

fieldIncludes = customfield_10101,customfield_11011,customfield_10204
fieldExcludes = customfield_11100, customfield_11101, customfield_11102, customfield_11103, customfield_11104, customfield_11105, customfield_11106, customfield_10300

1.condition.SBOX.*.* = true

After making these changes, I see that the custom clone operation exists in the menu with the correct "MyClone+" label, and although it does set the summary to "Foobar", the two custom fields are still not set.

Perhaps related to this issue is the fact that those two fields (10204 and 11011) are not available on the screen shown to the user during the clone operation. We only ever make those two custom fields available on the edit and/or view screens, never on create. Could this be related?

For what it is worth, our end goal is to simply have custom field 10204 set to its default value (which is -1) when performing the clone. We first started out by putting this field in the fieldExcludes list...but then the field ended up receiving a null value instead of the default value, which isn't what we wanted, and which brought us over to the custom clone area.

(continued in next comment...)

This is getting too detailed for here. Can you please create an issue so it can be tracked?

Done--JCPP-99. Thanks!

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 27, 2018 in Portfolio for Jira

Introducing a new planning experience in Portfolio for Jira (Server/DC)

In the past, Portfolio for Jira required a high degree of detail–foresight that was unrealistic for many businesses to   have–in   order to produce a reliable long-term roadmap. We're tur...

2,565 views 15 21
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you