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 get issue type all "Link issue" ?

Edited
Alex
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 Leaders.
Nov 21, 2023

Hello Atlassian community!

I encountered a problem when I started working with the post function:

"Set Field Value Post Function"

I want my field to take a certain value, if condition receives:

"The current task does not have an associated task with type "Test" ".

My code, unfortunately, only works when there is one link. If there are many links, the code does not work.

 

issue.get("issuelinks")?.first()?.getDestinationObject().issueTypeId == "16205"

What needs to be changed in it?

 

Any help is important!

Thank you!

 

 боль.png

2 answers

1 accepted

0 votes
Answer accepted
Alex
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 Leaders.
Nov 24, 2023

The question is no longer relevant. I added my answer to my profile in another post.

https://community.atlassian.com/t5/Jira-questions/How-get-issuetype-in-linkissue-from-Groovy-Scriptrunner/qaq-p/2541515

0 votes
NIKOLAS FREIRE EXT
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!
Nov 21, 2023

Hello, i have some exemple how you can access thye linked issues with python.

from jira import JIRA

user = 'your user'

apikey = 'your api key'

options = {
 'server': server
}

jira = JIRA(options, basic_auth=(user, apikey))
# Sua consulta de filtro aqui
filter_query = 'project in ("your filter")'

# Executando a consulta de filtro
issues = jira.search_issues(filter_query, maxResults=None)  # Remova maxResults para obter todos os resultados

# Variáveis para rastrear totais
total_outward_issues = 0
total_inward_issues = 0
all_issue_keys = []

# Itere sobre as issues retornadas
for issue in issues:
    all_issue_keys.append(issue.key)  # Adicione a chave da issue à lista

    # Acesse as "linked issues" (issues relacionadas)
    linked_issues = issue.fields.issuelinks

    # Conte as "linked issues" desta issue
    outward_issue_count = 0
    inward_issue_count = 0

    for link in linked_issues:
        if hasattr(link, 'outwardIssue'):
            outward_issue_count += 1
        if hasattr(link, 'inwardIssue'):
            inward_issue_count += 1

    # Adicione os totais parciais aos totais gerais
    total_outward_issues += outward_issue_count
    total_inward_issues += inward_issue_count

# Conte o número de chaves únicas
unique_issue_keys = len(set(all_issue_keys))

# Imprima os totais consolidados
print(f'Número de issues únicas: {unique_issue_keys}')
print(f'Total de outward issues: {total_outward_issues}')
print(f'Total de inward issues: {total_inward_issues}')
Alex
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 Leaders.
Nov 21, 2023

The question is not about implementation in Python

Suggest an answer

Log in or Sign up to answer