Hi Team,
I have 2 select list fields( risk impact , risk occurence probablity)
I have created scripted field called risk level(calculated) and written down the below script, but not getting value in the risk level(calculated ) field , eve though no error in the script:
kindly please help:
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.fields.CustomField
import com.atlassian.jira.issue.Issue
import java.util.logging.Logger
Logger logger = Logger.getLogger("")
logger.info ("I am a test info log")
Issue mainIssue = issue
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def riskimpact = customFieldManager.getCustomFieldObject("customfield_18484") as Integer
def riskoccprobablity = customFieldManager.getCustomFieldObject("customfield_18483") as Integer
if ( ( riskimpact * riskoccprobablity) == 0)
{
logger.info ("Value has been updated")
return 0
}
else if ( ( riskimpact * riskoccprobablity) < 4)
{
logger.info ("Value has been updated")
return 1
}
else if ( ( riskimpact * riskoccprobablity) < 8 )
{
logger.info("Value has been updated")
return 2
}
else
{
logger.info("Value has been updated")
return 3
}
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.