Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

We are using the python scripts on dev instance jira 7.6.1.

somanath kondeti February 2, 2018

Currently, we are using the python scripts on jira 7.6.1 on dev instance. There is a one script used in project ISC central planing .In this project workflow, we have used this script.

 

Description: This script is used in ISCCP Jira project. (JIRAREQ-3648)
# This validate that "Fail Category" field is required when Component contains 'OARS' only for all types except bug type (JIRAREQ-3940).
# Date: 2016-03

# -*- coding: UTF-8 -*-
import com.atlassian.jira.issue.CustomFieldManager

result = True
description = 'Error - "Fail Category" field is required when Component contains "OARS"'

#get issue type
issueType = issue.getIssueTypeObject().getName()
if issueType != 'Bug':
#Check if component contains "OARS" value
components = issue.getComponentObjects()
if components is not None:
hasOarsComponent = False
for component in components:
if component.getName()=='OARS':
hasOarsComponent = True
break

if hasOarsComponent:
customFieldManager = ComponentManager.getInstance().getCustomFieldManager()
cf = customFieldManager.getCustomFieldObjectByName("Fail Category")
if cf is not None:
cf_value = issue.getCustomFieldValue(cf)
if cf_value is None:
result = False

# this is an empty placeholder for edit validation script

 

With in the project, I am trying to create the issue, when i choose component=OARS except issue type "BUG"  Error - "Fail Category" field is required when Component contains "OARS"'

Can anyone tell me the , how can i overcome this issue.

 

Thanks,

somu

 

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events