New Ranks & Badges For The Community!
Notice something different? The ranks and associated badges have gone "Star Fleet". See what they all mean HERE
Highlighted
Absent Member.
Absent Member.
4537 views

Count of Reopen Defects

Jump to solution

Hey Friends,

 

I have one requirement in which I am trying to get the number of times a defect status has been changed to Reopen.

 

I want to have a new field named as  Re-Open Counter  which gets updated everytime the defect status is changed to Reopen.

 

Please help me.How to go about it.

 

Thanks

KV_2011

0 Likes
1 Solution

Accepted Solutions
Highlighted
Fleet Admiral
Fleet Admiral

In Bug_CanPost add this (assuming you have created a new numerical user field Re-Open Counter  as BG_USER_01:

 

If Bug_Fields("BG_STATUS").IsModified AND Bug_Fields("BG_STATUS").Value = "Reopen" Then

    If Bug_Fields("BG_USER_01).IsNull Then

         Bug_Fields("BG_USER_01).Value = 1

    Else

         Bug_Fields("BG_USER_01).Value = Bug_Fields("BG_USER_01).Value + 1

    End If

End If

 

You can either set the field as not visible to users or you could make it readonly to prevent users from modifying it directly.

 

Jan Czajkowski

[Please do not contact me off line for receiving support. Use the forum!]

View solution in original post

6 Replies
Highlighted
Fleet Admiral
Fleet Admiral

In Bug_CanPost add this (assuming you have created a new numerical user field Re-Open Counter  as BG_USER_01:

 

If Bug_Fields("BG_STATUS").IsModified AND Bug_Fields("BG_STATUS").Value = "Reopen" Then

    If Bug_Fields("BG_USER_01).IsNull Then

         Bug_Fields("BG_USER_01).Value = 1

    Else

         Bug_Fields("BG_USER_01).Value = Bug_Fields("BG_USER_01).Value + 1

    End If

End If

 

You can either set the field as not visible to users or you could make it readonly to prevent users from modifying it directly.

 

Jan Czajkowski

[Please do not contact me off line for receiving support. Use the forum!]

View solution in original post

Highlighted
Absent Member.
Absent Member.
Thanks Jan.It worked for me.

-KV
0 Likes
Highlighted
Absent Member.
Absent Member.

This code works for the new defects only.

 

How can the same thing done for historic data in the defects tab?

0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

I beleive your only option there may be to run an excel report with some macros taking into account the number of times the status has changed for a defect (increment a field for each time a defect field changed state from old value = closed to new value = open). That bit of historical data isn't something that can be called from the UI in any way afaik.

0 Likes
Highlighted
Absent Member.
Absent Member.

CAN you please send the full code

 

 

Regards,

Abdeen.

0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Hi.

 

Probably the best option will be to run once sql mass update - get data from audit_log and audit_properties and update all defects in bug table to get historical data. Next the count of reopened statuses will be updated by workflow code.

 

Br,

Tomas

[If my advice solves your issue or query, please mark the thread as solved. Clicking on KUDOS star is the best way how to say thank you.]
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.