HashtagLegal
Software solutions for legal world.

Show Workspace Template

Who's My Daddy?

This Relativity script shows workspace name and template that was used to create it.

 
 

<script>
    <name>Who's my daddy?</name>
    <description></description>
    <category></category>
    <input orientation="horizontal" />
    <display type="itemlist" />
    <action returns="table"><![CDATA[
    


select eddsdbo.[Case].ArtifactId, eddsdbo.[Case].[Name] into #ControlTable from edds.eddsdbo.[Case]

CREATE TABLE #Report (ArtifactID INT, Workspace NVARCHAR(255), TemplateArtifactID INT, TemplateName NVARCHAR(255))


declare @CaseArtifactID int
declare @TempDbArtifactID int
declare @ParentDBArtifactID int
declare @sql varchar(max)
declare @CurrentDBName varchar(max)

while exists (select * from #ControlTable)
begin

    select @CaseArtifactID = (select top 1 ArtifactId
                       from #ControlTable
                       order by ArtifactId asc)


        select @CurrentDBName = replace((select top 1 Name
                       from #ControlTable
                       order by ArtifactId asc),'''','')

        IF @CaseArtifactID <> -1
    BEGIN
        SET @sql = 'INSERT INTO #Report (ArtifactID, Workspace, TemplateArtifactID, TemplateName) SELECT top 1 ' + convert(varchar(max),@CaseArtifactID) + ',''' + @CurrentDBName + ''', [CaseTemplateID], [EDDS].[eddsdbo].[Case].[Name]  FROM [EDDS' + convert(varchar(max),@CaseArtifactID) + '].[EDDSDBO].[CaseEventHandlerHistory] 
        INNER JOIN [EDDS].[eddsdbo].[Case] on CaseTemplateID = [EDDS].[eddsdbo].[Case].[ArtifactID]    '
        EXEC(@sql)
    END
    

    delete #ControlTable
    where ArtifactId = @CaseArtifactID

end

select * from #Report

drop table #ControlTable
drop table #Report


    

    ]]></action>
</script>

 

 

 

This product may only be used by parties with valid licenses for Relativity®, a product of kCura LLC.  kCura LLC does not test, evaluate, endorse or certify this product.

 

This software provided by HashtagLegal (Nikolai Pozdniakov) is supplied AS IS without any warranties and support. HashtagLegal (Nikolai Pozdniakov) assumes no responsibility or liability for the use of the software and makes no representation or warranty that such application will be suitable for the specified use.