How to create a custom field type whose value depends on another custom field?

Hi,

I want to have a simple custom field which is like a flag true | flase. It should calculate its value based on value of other custom fields.

I am able to do this using following code :

Object soSignoff = arg1.getCustomFieldValue(customFieldManager.getCustomFieldObject("customfield_10226"));
		Object pdSignoff = arg1.getCustomFieldValue(customFieldManager.getCustomFieldObject("customfield_10224"));
		return (soSignoff != null && pdSignoff!=null)? "Approved" : "Not Approved";

But one problem with above code is hardcoded ids of custom fields. I want it to be more generic so that in different projects/contexts I should be able to provide set of custom fields based on which it should calculate the value.

Note : I haven't tested above code yet.

1 answer

1 accepted

Hi,

information about adding configuration to custom field is in Practical JIRA Plugins (O'Reilly, 2011). For quick (not so nice sollution) you can use default value or description fields.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted 6 hours ago in Off-topic

Miscellaneous Monday - CreatatronV3

You may remember, not so long ago, that together we invented the most evil of machines: The Destructo5000!  The effects of missing Durian rippled over nations. Complete chaos as goat chee...

55 views 4 2
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