Re: Workflow code to verify that a defect is being assigned to a cycle that is still within valid da (397 Views)
Reply
Respected Contributor
Craig_Drummond
Posts: 127
Registered: ‎03-28-2012
Message 1 of 5 (440 Views)

Workflow code to verify that a defect is being assigned to a cycle that is still within valid dates

I need to add some workflow code to do a basic validation but I have not been able to find any way to accomplish it and no other posts with suggestions.

 

Use Case:  I have set up Release A.  Inside Release A I have Cycle A and Cycle B.  Cycle A's dates are from June 1, 2013 to June 30, 2013 and Cycle B's dates are from July 1, 2013 to July 31, 2013.

 

When a defect is being created and a Cycle is selected I need to validate that the cycle selected is still valid based on the dates.

 

I can enter a look when BG_TARGET_RCYC is modified.  I can get the Name and NodeID of the Cycle that was selected.  But I can't figure out if the current date is beteween the start and end dates of the selected Cycle.

 

Anyone ever seen anything like this or know how I can use the Cycle_Fields data for the specific cycle that has been selected?

 

Thanks

 

Craig

Please use plain text.
Trusted Contributor
ameyjo
Posts: 120
Registered: ‎04-03-2012
Message 2 of 5 (427 Views)

Re: Workflow code to verify that a defect is being assigned to a cycle that is still within valid da

Hi

 

Think you can access the cycle factory and review the dates or use the command object,  the HP refence documentation in the HELP documentation library should provide some guidelines. Also check at the SSO sites for more samples .

 

Regards

"HP Support
If you find this or any post resolves your issue, please be sure to mark it as an accepted solution"
Please use plain text.
Respected Contributor
Craig_Drummond
Posts: 127
Registered: ‎03-28-2012
Message 3 of 5 (413 Views)

Re: Workflow code to verify that a defect is being assigned to a cycle that is still within valid da

While I appreciate the reminder about the manual, I am hoping that someone has done something similar and can provide a workflow code example of reading the start or end date of a cycle from what was selected while creating a defect, from within the the defect WorkFlow.

 

Craig

Please use plain text.
Honored Contributor
Jan Czajkowski
Posts: 2,054
Registered: ‎12-12-2007
Message 4 of 5 (397 Views)

Re: Workflow code to verify that a defect is being assigned to a cycle that is still within valid da

Try this for example in Bug_FieldChange:

MsgBox Bug_Fields("BG_TARGET_RCYC").Value.StartDate
Jan Czajkowski

[Please do not contact me off line for receiving support. Use the forum!]
Please use plain text.
Visitor
Yogeesh_kg
Posts: 3
Registered: ‎02-13-2014
Message 5 of 5 (237 Views)

Not able to initiate an action form Defect Workflow in ALM 11.0

Hi ,

I m trying to invoke "AssignResponsibilityToSAP" action from Defects Module work flow. It will be invoked via a Custombutton in Defects Module. This is to Asign responcibility to SAP after the defect is closed. This is for all the Closed "SAP related defects". But the action is not working. Can any one please to let me know, Is there anything wrong with the below code.

___________________________

Function Defects_ActionCanExecute(ActionName)
On Error Resume Next
If ActionName = "Defects_Action2" then
If User.IsInGroup("TDAdmin") then
Defects_ActionCanExecute = True
' tdc is the global TDConnection object.
Set BugFact = TDConnection.BugFactory
' Set the bug factory filter.
Set BugFilter = BugFact.Filter
BugFilter.Filter("BG_STATUS") = "Fixed or Closed"
'Create a list of defects from the filter
Set bugList = BugFilter.NewList

For Each theBug In bugList
If theBug.Field("BG_EI_DEFECT_TYPE") = "SAP Related Defect" and theBug.Status = "Closed" then
If theBug.Field("BG_EI_RESPONSIBILITY") = "Quality Center" then
' MsgBox " SAP Related Defect Closed Quality Center"
' Msgbox (Actions.Action(".Defects.AssignResponsibilityToSAP").Enabled)&"1"
Actions.Action(".Defects.AssignResponsibilityToSAP").Execute
Actions.Action("RfrshAct").Execute
' Msgbox (Actions.Action(".Defects.AssignResponsibilityToSAP").Enabled)&"2"
theBug.Post
theBug.Refresh
Actions.Action("RfrshAct").Execute
' KK = theBug.Field("BG_EI_RESPONSIBILITY")
' Msgbox KK
msg = msg & theBug.ID & ", " & theBug.Summary & ", " & theBug.Status & Chr(13)
End If
End If
Next
MsgBox msg
Else
Defects_ActionCanExecute = False
MsgBox " You do not have authorization to execute this"
End if

Set BugFilter = Nothing
Set BugFact = Nothing
Set bugList = Nothing

End if
On Error GoTo 0
End Function
___________________________


Thanks,

Yogeesh KG  

Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation