Capture component information at resolution time

Rahul Aich [Nagra]
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.
May 18, 2014

Hi

I want to be able to capture the snapshot of component field values when the issue moved to resolved state,#

So, i created a custom field - component_at_resolution and added a post function copy field values to field and copied over Components to this new custom field.

The problem is that when i see the result on the view issue screen, it is showing me like this

[GenericEntity:Component][id,1526][project,426][description,null][name,Component A][lead,null][assigneetype,0][url,null],[GenericEntity:Component][id,1553][project,426][description,null][name,Component B][lead,null][assigneetype,0][url,null]

How do i fix this.

PS: I chose component_at_resolution to be single line text custom field

Rahul

3 answers

0 votes
David _old account_
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.
May 19, 2014

You could use the Set Field Value to Constant or Groovy Expression post function to set your text field based on some formatting of the Components field value. This requires Groovy coding though.

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.
May 18, 2014

Ah, this is down to data types.

Components are represented by component objects in the database. I suspect your custom field is a string, so when you copy <component> into it, you're getting a rather ugly representation of a set of component objects dumped into it.

You need to iterate over the list of component objects and extract their names to strings if you want a "clean" representation of them for the humans (but bear in mind that they won't be components any longer, just a list of names)

0 votes
BenjiI
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.
May 18, 2014

Hi Rahul,

Can you share with us the format that you would like to have?

Suggest an answer

Log in or Sign up to answer