The CreatorCon Call for Content is officially open! Get started here.

stories

pragadeesh254
Tera Contributor

As a platform owner, I want to be to able to create story from an enhancement record AND
when 
story is created, 
if story state -> draft, enhancement state -> scoping
story state -> ready, enhancement state - > work in progress
story state -> cancelled, enhancement state - > cancelled
story state -> complete, enhancement state - > complete

9 REPLIES 9

Danish Bhairag2
Tera Sage

Hi @pragadeesh254 ,

 

You can create a BR in order to achieve this requirement.

 

(function executeRule(current, previous) {

    // Check if story state is changed to draft

    if (current.state == 'draft') {

        // Update corresponding enhancement record state to scoping

        updateEnhancementRecord(current.enhancement_field, 'scoping');

    }

    // Add similar conditions for other states

 

})(current, previous);

 

// Function to update enhancement record

function updateEnhancementRecord(enhancementID, newState) {

    var enhancementGR = new GlideRecord('Enhancement');

    if (enhancementGR.get(enhancementID)) {

        enhancementGR.state = newState;

        enhancementGR.update();

    }

}

 Similarly u can have different conditions involved for all diff states.

 

Thanks,

Danish

 

But in stories there is no state called enhancement state

 

Hi @pragadeesh254 ,

 

Enhancement state must be a field correct on story table?

 

Thanks,

Danish

 

but there is no enhancement field