Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

How to remove issuelinks from the JIRA id using python jira

Edited

Hi ,

 

I am using JIRA python to update to issue link(duplicate link) for JIRA id and it works fine.

Now i want to remove those issue link from that JIRA id 

 

Any Idea pls

1 answer

1 accepted

0 votes
Answer accepted

I am able to do in using below code

 

#getting issue links

#create JIRA instance
self
.jira = JIRA(basic_auth=(self.jira_username, self.jira_api_token), options={"server": self.jira_server})
#Pass JIRA name and get Issue links
idl=self.jira.issue(jiraid) # passing JIRA name
getIssuelinks=idl.fields.issuelinks #issuelinks
#iterate and delete
for
x in getIssuelinks:
print(x.id)
self.jira.delete_issue_link(x.id) 
Julio Domingues
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
Sep 11, 2023 • edited

Could you clarify : 

idl=self.jira.issue(jiraid) # passing JIRA name
getIssuelinks=idl.fields.issuelinks #issuelinks

Since id1 is a dictionary this does not work,
I should be doing something wrong.

My Code:
from atlassian import Jira
import json
jira = Jira(
url='https://aa.bb.com/',
token='someToken')

issueData = jira.issue("BBBB-1000")
json_formated= json.dumps(issueData, indent=1)
getIssuelinks=issueData.fields.issuelinks #issuelinks
print(json_formated)

Error:
Traceback (most recent call last):
File "C:\Data\repositories\jira_python\jira\jira_test.py", line 9, in <module>
getIssuelinks=issueData.fields.issuelinks #issuelinks
^^^^^^^^^^^^^^^^
AttributeError: 'dict' object has no attribute 'fields'

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events