Hi,
I need to move (A) Project components to (B) Project Components, I can do this manually or via script runner, but I wanted to use it via rest api, I am currently using this script atlassian-api / atlassian-python-api
I have specified the correct project source key of source and destination but I got Status 400 Bad request from https://url_here/rest/api/2/component. What is the correct rest api for the component? I can get the status from rest/api/2/project/key/components but not in https://url_here/rest/api/2/component. Do you have any recommendation to fix this problem? Thanks in advanced!
Jira version: v8.5.4 Jira Project Management Software
# coding=utf-8
from atlassian import Jira
import logging
logging.basicConfig(level=logging.ERROR)
jira = Jira(
url="https://url_here/",
username="username",
password="password")
DST_PROJECT = jira.get_project_components(key='PROJECT_B')
SRC_PROJECT = jira.get_project_components(key='PROJECT_A')
components = jira.get_project_components(key='SRC_PROJECT')
for component in components:
data = {"project": DST_PROJECT,
"description": component.get('description'),
"leadUserName": component.get('leadUserName'),
"name": component.get('name'),
"assigneeType": component.get('assigneeType')
}
jira.create_component(data)
print("{} - component created ".format(component.get('name')))