Forums

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

Bulk import issues to an existing ticket

Aswathi D
Contributor
May 24, 2023

How to bulk import task to an existing story in jira ?
Can anyone please provide the CSV template as well ?

2 answers

2 accepted

1 vote
Answer accepted
Mark Markov
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
July 3, 2018

Hello @admin_tt

As @Roland Holban (Adaptavist) says you code is correct and will work, but with certain condition.

This post-funstion must be placed right before "Update change history for an issue and store the issue in the database." post-function that will write changes what was done during transition

If you need to place it lower, you need to modify your script like this:

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.ComponentManager
import com.atlassian.jira.event.type.EventDispatchOption
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.fields.CustomField

CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager()
def user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()

def pass_the_zero = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Pass_the_Zero");
def pass_the_one = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Pass_the_One");
def pass_the_two = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Pass_the_Two");

issue.setCustomFieldValue(pass_the_zero, 0);

issue.setCustomFieldValue(pass_the_one, 1);

issue.setCustomFieldValue(pass_the_two, 2);

ComponentAccessor.getIssueManager().updateIssue(user, issue, EventDispatchOption.ISSUE_UPDATED, false)
Михаил Дорохин
July 3, 2018

Morning! 

My bad: I've just noticed that I was trying to pass an int to a Number-field, and "0" is not a float. This is the root of the problem, I guess. 
Thanks for your reply! 

1 vote
Answer accepted
Roland Holban (Adaptavist)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
July 3, 2018

Im not understanding your question. The way you are doing it in your scrip is correctly setting the value of those custom fields to integers. 

Suggest an answer

Log in or Sign up to answer