-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Medium
-
Affects Version/s: 3.6.3
-
Component/s: Administration - Others
-
3.06
If you run this jelly script in an instance with the project and version and a version picker field called "Version Fixed" you will notice that the values for "Fixed Version" for each issue created are equal to the value of the issue created before with the next value appended. In this case it produces values with the same single value multiple times. Note that you need the forEach, CreateIssue and AddCustomFieldValue all together. This is a common scenaio, however, because this is how you need to create multiple issues which have custom field values.
<JiraJelly xmlns:jira="jelly:com.atlassian.jira.jelly.enterprise.JiraTagLib" xmlns:core="jelly:core" xmlns:log="jelly:log" xmlns:sql="jelly:sql" xmlns:fn="jelly:fn" xmlns:util="jelly:util" > <util:tokenize var="names" delim=",">foo,bar,baz</util:tokenize> <core:forEach var="summary" items="${names}"> <jira:CreateIssue project-key="PD" issueType="Bug" summary="issue ${summary}" assignee="-1" reporter="admin" description="mister description" issueIdVar="newIssueId" issueKeyVar="newIssueKey" priority="${currentIssuePriority}" > <jira:AddCustomFieldValue name="Version Fixed" value="10007"/> </jira:CreateIssue> </core:forEach> </JiraJelly>
The problem is in how the AddCustomField and CreateIssue jelly tags interact. Also note JRA-5562.
Also see https://support.atlassian.com/browse/JSP-6602 for the original discovery and more context.
Note there is a nasty workaround which if you ad a key="blah" (value doesn't matter) attribute to the AddcustomFieldValue tag, it will work as it should because it bypasses the multi-value dummy key derivation which is doing the appending. The root cause is the CreateIssue tag is not a new instance on each invocation and its properties object is reused.
- is related to
-
JRASERVER-10881 Jelly: In CreateIssue adding values to Cascading Select custom fields only works on first iteration of loops - error thereafter
-
- Closed
-
- relates to
-
JRASERVER-10986 Jelly: jira:AddCustomFieldValue type of tag independant of jira:CreateIssue
- Closed