'How do I read unknown Java code for JIRA? [closed]

First post here!

I am very new to Java and am trying to decipher this code regarding JIRA. Could anyone help explain what it means?

import org.apache.log4j.Logger
import org.apache.log4j.Level
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.component.ComponentAccessor


log.setLevel(Level.DEBUG)
log.debug("scriptField.")


CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager()


def REC = customFieldManager.getCustomFieldObject("customfield_10563")
def Pro = customFieldManager.getCustomFieldObject("customfield_10605")


def R = issue.getCustomFieldValue(REC).getValue() as int;
def P = issue.getCustomFieldValue(Pro).getValue() as int;


return R * P


Solution 1:[1]

This is a simple Groovy code which returns product of two CustomField objects' value of an issue in Jira.

You can find these customfields from their id; by looking the database's customfield table or through Jira REST API.

For further information about the Groovy code, you can check out the documentation of ScriptRunner plugin.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 stuck