Here is the issue I am trying to solve for.
Our team uses the "Component" field to represent a master project number. Each master project number has 12 sub-project numbers under it however these are not populated in the "Component" field. Based on the "Component" and the custom field "Release" you could look up the value for the sub-project number from an outside system, but this doesn't meet the needs of the team. They would like that information directly in JIRA so that we have one source of truth. The idea is to have a new custom field called "Sub-Project Number."
I'm trying to figure out if we can update the "Sub-Project Number" based off the "Component" and "Release" field values. Due to the number of Components, Releases and Sub-Project Numbers and the fact it will be changing regularly I can't imagine hard scripting it, but think instead we would need some sort of lookup table so the table could be updated versus the script and then the script would go look at the table.
As a note, we have ScriptRunner which I am quite new to using which might be an option. We also have Confluence if that might be useful to house the table.
Any help to guide me to what my options are would be greatly appreciated.
Hello there!
Since you have ScriptRunner, I recommend creating a scripted field to set the value of one field based on another.
Create the field in the "Script Fields" section under ScriptRunner in System > Add-ons. Then in the inline script, you can use the following code to get the components and releases:
def component = issue.components
def release = issue.fixVersions
After that, you can create some logic on top of the component and release variable to return the value you want in the "Sub-Project Number" field.
Kind regards,
Maurício Karas
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.