How to create a custom field that is the weighted average of 3 other fields on the issue?

Daren Drummond June 30, 2016

This question is in reference to Atlassian Documentation: Adding a custom field

I want to create a custom field that is the weighted average of 3 other fields on the issue.  This should be dirt simple with some kind of script, but I can't find any recent documentation on how to do this.  A google search turns up the following link, but the "JIRA Misc Custom Field" plugin doesn't appear in the market place search.  

https://marketplace.atlassian.com/plugins/com.innovalog.jmcf.jira-misc-custom-fields/server/overview

What are my options?  Thanks in advance.

2 answers

1 accepted

1 vote
Answer accepted
Steven F Behnke
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.
June 30, 2016

You have precious few options in the Cloud environment. Misc Custom Fields is not avaliable for Cloud.

Atlassian has recently announced an API that would allow add-ons to control fields from JIRA Cloud, so this functionality may not be available yet but it will come out.

Daren Drummond June 30, 2016

Thanks for the quick response Steven.  Clicking around I found the "Add Post Function To Transition" screen and the "Set Field Value to constant or Groovy expression" option.  Do you think I can use Post Functions on the onCreate and onUpdate events to solve my problem?

Steven F Behnke
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.
June 30, 2016

The "groovy expression" portion is disabled in Cloud. You cannot run arbitrary scripts in the cloud environment unfortunately. You can use "Set field value to constant" or "Copy field to field" but these won't let you perform math.

One of the services my company provides is to supplement functionality of the Cloud environment. Let me explain how that works – 

  • We provide a service running on another webserver
  • The service consumes events (Webhooks) or runs queries (over REST) periodically
  • The service performs actions or operations based on logic we've defined

Perhaps this model would work for you, or perhaps you could hire an Expert to provide this feature for you.

image2016-6-30 11:48:47.png

 

Finally, you could also write a Connect Post-Function yourself – https://developer.atlassian.com/static/connect/docs/latest/modules/jira/workflow-post-function.html

0 votes
MattS
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.
June 30, 2016

We do this in JIRA Server using the ScriptRunner add-on for a number of customers.

For Cloud with limited scripting it's harder. You could have a remote script run periodically to update a field in issues that have changed but it may not scale well for more than 10K issues being updated.

 

 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events