Welcome Serena Central users! CLICK HERE
The migration of the Serena Central community is currently underway. Be sure to read THIS MESSAGE to get your new login set up to access your account.
Highlighted
Member.. DarrielleP
Member..
248 views

Need Script to Determine Cycle by Date

We are leveraging the Target Cycle field on the TestRun object, and want to compare the Target to an actual. We added a User_Field (Executed_Cycle) on the TestRun, which currently is entered manually. My goal is to have  script populate this field based on the trigger of clicking 'Run', but to do this I need to perform a lookup to the Cycle table , and determine which cycle [today's date] is in, by comparing today's date to the beginning and end dates of each of the Cycles in the Release. This is where I'm stuck. I would be greatful for suggestions!

0 Likes
1 Reply
Knowledge Partner Knowledge Partner
Knowledge Partner

Re: Need Script to Determine Cycle by Date

I would assume you have associated the folders in Test Lab to Cycles? In that case you already have a reference to that Cycle available in each new Run. For example in Run_MoveTo:

Set CycleObject = Run_Fields("RN_ASSIGN_RCYC").Value                               

And now you can easily check the start and end dates and compare them to today's date:

MsgBox  CycleObject.StartDate
MsgBox  CycleObject.EndDate
MsgBox  Date                                         ' VBScript function for current system date
MsgBox  CycleObject.EndDate > Date  'True or False
Jan Czajkowski

[Please do not contact me off line for receiving support. Use the forum!]
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.