Hi
We are currently in the migration process and i am trying to re-write a script runner field in cloud. There is a xyz custom fields which tells the total of all these below fields.
Script in on-prem:
def NewCustomers = getCustomFieldValue("Direct sales potential new customers") as Float
def ExistingCustomers = getCustomFieldValue("Direct sales potential existing customers") as Float
def Prerequisite = getCustomFieldValue("Feature is a prerequisite for sales to new/existing customers") as Float
def Impact = getCustomFieldValue("Strategic Impact ATOSS") as Float
def Maintenance = getCustomFieldValue("Maintenance downtime/escalation") as Float
def COS = getCustomFieldValue("COS - Reduction of operating expenses") as Float
def CSS = getCustomFieldValue("CSS - Reduction of implementation effort") as Float
return (0.15 * (NewCustomers ?: 0) +
0.15 * (ExistingCustomers ?: 0) +
0.15 * (Prerequisite ?: 0) +
0.25 * (Impact ?: 0) +
0.10 * (Maintenance ?: 0) +
0.10 * (COS ?: 0) +
0.10 * (CSS ?: 0)
)
in the above section all are the custom fields with number text field.
I am having problems to migrate it and showing the total number of the fields.
Thanks
Hi Sen,
I can confirm that in Cloud currently, scripted fields show under a specific section for scripted fields, but we are currently working on making scripted fields actual custom fields.
This will be released shortly, and you should watch the Release Notes pages to see when it is released.
As for the script in Jira Cloud, you will need to access the fields using the rest APIs which Jira Cloud provides and have an example of using a script listener to calculate a custom field on issue update, which sums up a series of number fields and returns the total.
This example will need to be modified just to return the summed value as scripted fields need to return a value to be shown on the issue, and we have a scripted field to sum up story points on an issue example here, which shows this.
You can use these examples as a reference to help write the script you require for your scripted field.
I hope this information helps.
Regards,
Kristian
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.