script runner code not giving expected results

Hi Team ,

 

I have a requirement to  fetch tempo work attribute (Activity-Static drop down) value.

I need to extract time entered on issues only against value "Review" in activity drop down.

Log work tab 

Worked     Description    Activity

2 hrs          test 1             Review

3 hrs          test2              Code

 

so i need to fetch activity value and compare it with string " Review".

If activity value is review i need to fetch logged time (2 hrs).

 

To start with how to fetch work attribute i am following  

https://scriptrunner.adaptavist.com/latest/jira/plugins/working-with-tempo.html

documentation.

I have implemented exactly similar structure and running same code.

Over time     hours

Checked       3hrs

unchecked   5 hrs

document claims that script code will return " 3 hrs" whenever overtime is checked.but when i am running it is giving me sum of all

 

Note : My requirement is to fetch time logged against activity value "review" in .groovy script to generate report using PDF view plugin.

I am not very sure about how to do it in .groovy so starting with implementing in script runner.

 

 

Additionally it will be great help if any one could send me script runner code to  fetch activity value and compare it with string. 

Activity values can be Review,Code,Design etc but i need to fetch time which is logged against activity "Review"

Log Work.png

Please advise

 

Thanks,

Anees Sultana

0 answers

Suggest an answer

Log in or Join to answer
Community showcase
Teodora [Botron]
Published Thursday in Marketplace Apps

Jira Inferno: The Nine Circles of Jira Administration Hell

If you spend enough time as a Jira admin - whether you are managing a single, mid-sized instance, a large enterprise one or juggling multiple instances at once - you will eventually find yourself in ...

409 views 1 13
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot