I've implemented a Blitz Action button to allow me to create and link an issue to the current issue.
I'm able to copy over values from several existing issue custom fields to the new issue custom fields. The problem is that I cannot copy over such values for my Project Specific Select field.
I've tried two approaches, both of which work for the standard JIRA select field (Platform) but do not work for the Project Specific select field (Goal).
Approach #1 used custom field mappings:
// Get values passed from screen script
string newSummary = getElement(argv, 1);
string newDescription = getElement(argv, 3);
string newDesigner = getElement(argv, 5);
// Create new "UI Design" issue
date newDueDate;
interval estimate;
string[] newComponents;
string issueType = "UI Design";
string[] customFieldMappings = { "Designer", newDesigner, "Product Manager", #{Product Manager}, "Platform", #{Platform}, "Goal", #{Goal} };
string newIssueKey = createIssue(
project,
"", // parent issue key
issueType,
newSummary,
priority,
newDescription,
newComponents,
newDueDate,
estimate,
securityLevel,
customFieldMappings);
Approach #2 uses code to set the field value explicitly if in context:
// Get values passed from screen script
string newSummary = getElement(argv, 1);
string newDescription = getElement(argv, 3);
string newDesigner = getElement(argv, 5);
// Create new "UI Design" issue
date newDueDate;
interval estimate;
string[] newComponents;
string issueType = "UI Design";
string[] customFieldMappings = { "Designer", newDesigner, "Product Manager", #{Product Manager} };
string newIssueKey = createIssue(
project,
"", // parent issue key
issueType,
newSummary,
priority,
newDescription,
newComponents,
newDueDate,
estimate,
securityLevel,
customFieldMappings);
// Set new issue's Goal field (Does not work for Project Specific select field)
if (isCustomFieldInContext("Goal", project, issueType) && #{Goal} != "")
{
%newIssueKey%.#{Goal} = #{Goal};
}
// Set new issue's Platform field (This works for standard JIRA select field)
if (isCustomFieldInContext("Platform", project, issueType) && #{Platform} != "")
{
%newIssueKey%.#{Platform} = #{Platform};
}Any hints would be much appreciated.
Thanks,
Neil Wheaton