DevOps Automation

DevOps Automation

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.


#DevOps
 View Only
  • 1.  Can I get data from CC into Excel?

    Posted Tue January 19, 2016 06:34 PM

    I recently upgraded to CC v8. I want to display some information about CC into an Excel dashboard, so I’m trying to automatically pull information from the back-end DB into Excel. I figured I should do this through ODBC or some API tool. I’m also investigating as to if it’s a possibility to query the CC database from Visual Studio or Microsoft SQL Server Development Studio. Any help is appreciated!



  • 2.  RE: Can I get data from CC into Excel?

    Posted Wed January 20, 2016 11:51 AM

    You can use VBA and the CC API to accomplish that. I use it in spreadsheets that create reports on branches, streams, baselines etc. Note: you want to do A LOT of error checking. No matter what goes wrong, Excel alway pops up the same generic error message. See example commands below.

    Set ccObj = CreateObject("ClearCase.Application")
    Set ctObj = CreateObject("ClearCase.ClearTool")
    Set viewObj = ccObj.View(viewName)
       
    Set vobObj = ccObj.VOB(vobTag)
    If Err.Number <> 0 Then
        MsgBox ("Cannot create a VOB Object for " & vobTag & ". " & vbCrLf & vbCrLf & Err.Description)
        Exit Sub
    End If
    If Not vobObj.IsMounted Then
        rCode = ctObj("mount " & vobTag)
        If Err.Number <> 0 Then
            MsgBox ("Cannot mount Vob " & vobTag & ". " & vbCrLf & vbCrLf & Err.Description)
            Exit Sub
        End If
    End If
     
    ' Store all the branches in an array
      branchArray = Split(ctObj("lstype -fmt ""%n\n"" -kind brtype -invob " & vobTag), vbCrLf)
      If Err.Number <> 0 Then
         MsgBox ("[GBR_020] Error with command: " & "cleartool lstype -fmt ""%n\n"" -kind brtype -invob " & vobTag & vbCrLf & vbCrLf & Err.Description)
         Exit Sub
      End If
           
           

    Jozef