Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Is there any way to set a custom text field can have the value as the project key automatically?

Jason Liu
Contributor
July 15, 2022

Hi, I want to have an automation. We have a custom field, text type. We want to copy the project key as its value automatically when creating the issue. Please tell me any way that can make it happen. Thank you so much.

1 answer

1 vote
Jeroen Poismans
Community Champion
July 15, 2022

Hi Jason,

There certainly is.
Create an automation that triggers on issue create. Then add an action "Edit issue". Here you can select the field to edit.

For the project key you should try this smart value: {{issue.project.key}}

Extra info concerning smart values you can find here:
https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/

 

Regards,

 

Jeroen

Jason Liu
Contributor
July 15, 2022

Hi Jeroen, we're using Jira server. Is this can be done? I didn't see where to create an automation and the documentation is about Jira cloud, right?

Nic Brough -Adaptavist-
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.
July 15, 2022

It can if you install the Automation app to support automations.  There are other apps that allow you to write scripts or update fields automatically.

I do want to question the desire for this though.  What problem would duplicating the project key solve?  The duplicate is utterly redundant plan text.  I can't think of any use for it. 

Like Jeroen Poismans likes this
Jason Liu
Contributor
July 17, 2022

Hi Nic, We are using Adaptavist ScriptRunner for JIRA. Is there any function can do that?

The user just wants to make this kind of custom field and when the issue has been cloned and moved to another project, or related with other project's issues, the value can be added automatically.

Nic Brough -Adaptavist-
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.
July 18, 2022

I'm sorry, but "the user wants to do this" does not tell us what problem they are trying to solve.

You can do it with Scriptrunner, I'm just questioning the point.  The data is in the history and you can still visit the old issue key and find where it has gone to.

Jason Liu
Contributor
July 18, 2022

Not trying to solve problem, just wants to tag the issues with the original issue's information, for the report. But anyway, thank you.

Nic Brough -Adaptavist-
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.
July 19, 2022

If there's no problem here, why are you trying to do this?

Your user has asked to duplicate data they already have into another field.  Why?  Of what use is this?  They would not have asked if they did not have a problem with it.  So what is that problem?

Jason Liu
Contributor
July 20, 2022

It's a request, not a problem. The user wants to count the relations with leading stories and supporting stories and tests and bugs. They want to have a field contains the related issue's key. We have created a script runner listener to do that. No more questions.

Nic Brough -Adaptavist-
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.
July 20, 2022

I am sorry, I am not making myself clear.

Why do they want this duplicated field?  What would tell them?  What is the problem you're trying to solve with it?

You've said "count relations" - this field is not going to help you do that.  Your issues are related to others by issue links, Epics and sub-tasks.  The project key tells you nothing about relations or history,.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
8.5.2
TAGS
AUG Leaders

Atlassian Community Events