Hi all together,
we use Jira Software Data Center 9.4.8 with ScriptRunner.
We've got a custom field of type "Text Field (read only)" and don't want it to be copied when an issue is cloned.
How can we manage this?
Best regards,
Gisela Lassahn
What you are trying to do is not doable directly with Automation.
Instead, I suggest just using ScriptRunner to achieve this.
Please clarify when exactly you want to trigger the issue cloning. Is it when you transition the issue?
Thank you and Kind regards,
Ram
Hi @Ram Kumar Aravindakshan _Adaptavist_ ,
the issues are cloned manually via the "Clone" action in the "More" menue within the original issue itself.
In Automation there's no trigger for the clone action but for "Issue created"; so I'm using this one instead.
We are new in ScriptRunner and still don't know all the possibilities.
It would be great if you could help us solving the issue with ScriptRunner.
Many thanks and kind regards,
Gisela
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have previously provided an answer in the Community of how you can Clone an Epic along with all its Issues and Sub-Tasks via Post-Function.
It is available in the Adaptavist Library.
So using a similar approach, you could use ScriptRunner add-on for Automation and add the code to trigger the cloning.
Please clarify based on what condition you intend to trigger the cloning.
Thank you and Kind regards,
Ram
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Gisela Lassahn ,
for my knowledge you can't do that. Automation has not a trigger for that event and a custom listener has not a specific event for issue cloning.
For a cloud instance there is an app for that (https://marketplace.atlassian.com/apps/1218652/deep-clone-for-jira?hosting=cloud&tab=overview&source=community58) but it seems to be not available for data center instance.
Fabio
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Fabio Racobaldo _Herzum_ ,
thanks for you hint.
Maybe we'll migrate to Jira Cloud in the future.
Then we'll test if the app is helpfull for us.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Create an automation based on issue created, due to the fact the clones links is added after the issue creation, you wil need a re-fetch issue action first.
Then have a condition on linked issues based on cloners link and if all is true, edit action to the cloned issue to empty the read-only text field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Marc - Devoteam ,
in our instance there are no clones links created when an issue is cloned because we didn't want those links and configured it out some years ago (see Configuring issue cloning | Administering Jira applications Data Center 9.4 | Atlassian Documentation).
But my problem is that the edit issue action doesn't work to clear read-only text fields.
This is how I did it. The field still is filled after cloning.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What is your complete rule, how will you now you are triggering on the cloned issue?
DO you have an identifier?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Marc - Devoteam ,
in new (not cloned) issue the field is always empty because it can only be filled lateron by another, manually triggered automation rule.
So, in this rule (triggered when an issue is created), I check if the field is empty and try to empty the field if it is not empty.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The audit log pretends that everything works fine, but the new (cloned) issue isn't really edited:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tried it myself and yes the field will not empty, but I did find a work around.
Set the read only text field to a non-breaking space.
To generate the non-breaking space character, hold Alt and type 255 on your numeric keypad.
There is also an open issue on this AUTO-614
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Marc - Devoteam ,
many thanks again!
I know AUTO-614 and allready voted for it some time ago. But I think it won't be put into action in the near future, and probably it's only going to be put in action for Jira cloud, because the project name is "Automation for Cloud".
The workaround you're describing is what we actually are using at the moment, but there are at least two negative side effects:
1. The field is shown in the view screen while really empty custom fields are not.
2. The issues are found when you use JQL to find issues with "... is not EMPTY" though they should not be found.
So I'm still searching for a better idea to solve my problem.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.