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
set.customfield_10204=-1
set.&lt;fieldname&gt;=-1
plus.set.customfield_10204=-1
set.10204=-1
set.cf10204=-1

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

Any pointers to the correct syntax would be appreciated!

Thanks,
Scott

1 answer

1 accepted

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 clone-plus.properties and add something like
    1.set.customfield_10204 = -1
    or 
    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!

Bob,

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
1.label=MyClone+
1.set.customfield_10204=-1
1.set.customfield_11011=http://www.yahoo.com
1.set.summary=Foobar

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?

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Julia Dillon
Posted Tuesday in Jira

Tell us how your team runs on Jira!

Hey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...

231 views 1 18
Join discussion

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