Empty a "Text Field (read only)" when an issue is cloned?

Gisela Lassahn
Contributor
March 4, 2024

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

4 answers

0 votes
Ram Kumar Aravindakshan _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 5, 2024

Hi @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

Gisela Lassahn
Contributor
March 5, 2024

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

Ram Kumar Aravindakshan _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 5, 2024

Hi @Gisela Lassahn

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

 

0 votes
Fabio Racobaldo _Herzum_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 5, 2024

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

Gisela Lassahn
Contributor
March 5, 2024

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.

0 votes
Marc - Devoteam
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.
March 5, 2024

HI @Gisela Lassahn 

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.

Gisela Lassahn
Contributor
March 5, 2024

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.

image.png

This is how I did it. The field still is filled after cloning.

Marc - Devoteam
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.
March 5, 2024

Hi @Gisela Lassahn 

What is your complete rule, how will you now you are triggering on the cloned issue?

DO you have an identifier?

Gisela Lassahn
Contributor
March 5, 2024

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.

image.png

Gisela Lassahn
Contributor
March 5, 2024

The audit log pretends that everything works fine, but the new (cloned) issue isn't really edited:

image.png

Marc - Devoteam
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.
March 5, 2024

Hi @Gisela Lassahn 

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 

Gisela Lassahn
Contributor
March 5, 2024

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.

Like Marc - Devoteam likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events