How to set customfield initial value calculated based on the value of this customfield in other issues?

Hi,

I have a customfield named "Internal code". This customfield must contain as initial value the next right internal code.

For example:

Issue1: Internal code=OX-001.001

Issue2: Internal code=OX-001.002

New Issue: The initial value for Internal code customfield must be: OX-001.003

 

Do you know which type of customfield must be "Internal code" and how to calculate the next right value? (using groovy, sil ......)

Thanks in advance

 

Begoña

3 answers

1 accepted

This widget could not be displayed.

Hey Begoña!

I suggest you take a look at the Script Runner add-on for JIRA Server. It has a feature called Scripted Fields which allows you to perform calculations on custom fields in JIRA.

The add-on is very straight-forward as it uses Groovy as its programming language, which, by itself, is very similar to Java.

I don't have that much knowledge on the add-on, I made very little scripts using that up to this point, but the documentation has some nice examples and there are lots of our users which are kind of specialists on this. I will tag your question with the 'script-runner' label, so that you may find lots of additional help on this here. wink

Cheers!

Joao

Thanks Joao! I'll study groovy and I'll try to solve this cuestion using them. Because I need: 1.- To propose an initial (calculated) value to the user (I'll try to use your suggestions) 2.- The user should change this solution (I think a Scripted Fields aren't editable) 3.- I need to control that the entry format meet an specific pattern I think I'll need at least 2 new customfields (scripted field + regex field) Thanks

This widget could not be displayed.

Any one knows any example of Scripted fields to do something like that (or some point of the following)?:

1.- Browse each issue in a project

2.- For each issue read the CF1 value

3.- Obtain a substring of this CF value (for example we call name this as Substr_CF1)

4.- After browse all issues to determine which is the maximom Substr_CF1 -> max_Subtr_CF1

5.- max_Substr_CF1+=1

6.- Propose as initial value for the new issue: first_part_of_CF1+max_SubstrCF1

This widget could not be displayed.

Thanks! This question has been solved in https://answers.atlassian.com/questions/12779641

 

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

292 views 5 0
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