How to get the bug id from the bug issue

Bharadwaj Jannu
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.
January 15, 2013

I have created a issue of type 'Bug'.

I am able to get this issue(eg: MYP-1 is an id for the issue)

Now, how to get the Bug id (i.e type id) using MYP-1

6 answers

1 accepted

0 votes
Answer accepted
ConradR
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.
January 15, 2013
issue.getIssueTypeObject().getId()

Bharadwaj Jannu
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.
January 15, 2013

This I tried as follow

if(parentIssue.getIssueTypeObject().getId()==1)

but not working

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 15, 2013

You really do need to think through your code. The line above IS working fine, but it's not doing what you expect.

Try looking at what it is actually returning - that should tell you more. For example, is id 1 really Bug? Are you looking at the right issue and is it definitely a Bug?

(If it's a sub-task, I really do think you'll find it is NOT a bug, but I don't have access to your system to check that instinct)

0 votes
Bharadwaj Jannu
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.
January 15, 2013

I need the id for "Bug" using "MYP-1"

0 votes
Nadir MEZIANI
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.
January 15, 2013
0 votes
Bharadwaj Jannu
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.
January 15, 2013

I need the id for "Bug"

0 votes
Nadir MEZIANI
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.
January 15, 2013

The id of issue type "Bug" or the id of issue "MYP-1"?

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 15, 2013

You don't say where you are doing this. Assuming it's in code, then look at the issue object.

Bharadwaj Jannu
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.
January 15, 2013

In Creating the subtask automatically when an issue is created

Mizan
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.
January 15, 2013

I think you are trying to check if the issuetype is a BUG, right ?

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 15, 2013

Sorry, that's not what I meant. We don't know what you are doing with "creating the subtask". If you've got the issue id, then you should have, or be able to get, an issue object, and then read that for more information (including type - where Conrad's answer is what you need to look at)

Bharadwaj Jannu
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.
January 15, 2013

Yes Mizan,You're correct

Mizan
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.
January 15, 2013

why you are not using the Create on transition plugin /script runner plugin which provides a postfunction to create a subtask ?

Bharadwaj Jannu
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.
January 15, 2013

I am in learning of JIRA and given the tasks how exactly we can implement the plugin for so and so required functionality.

Hence instead of going for third party plugin, I develop my own

and also in Create-on-transition-plugin I customized the fields which I don't require .

Mizan
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.
January 15, 2013

ok , then you can refer the source of Create on transition plugin

Suggest an answer

Log in or Sign up to answer