x
login Signup

How to set the pipeline name in workflow notifier

We have a pipeline which trigger a workflow as a stage.After the workflow stage finished,we wanted to capture the pipeline name that it ran from and set it in the workflow email notifier.Could someone give some idea on how to implement it.

avatar image By prataprn 15 asked Jul 05, 2017 at 05:34 PM
more ▼
(comments are locked)
10|750 characters needed characters left

1 answer: sort voted first

Please use $[/myPipeline/pipelineName]

Here is a sample dsl, which creates a pipeline and workflow. Pipeline task invokes the workflow and workflow state has a notifier

 project 'Default', {
   description = 'Default project created during installation.'
 
   procedure 'build', {
     jobNameTemplate = null
 
     step 'calc', {
       description = ''
       command = '''echo "hello"
 echo $[/myPipeline/pipelineName]'''
       condition = ''
       errorHandling = 'failProcedure'
     }
   }
 
   workflowDefinition 'wf', {
     description = ''
     workflowNameTemplate = ''
 
     stateDefinition 'st1', {
       description = ''
       startable = '1'
       subprocedure = 'build'
       subproject = ''
 
       emailNotifier 'notifier1', {
         description = ''
         configName = 'default'
         destinations = 'xyz@ec.com'
         eventType = 'onCompletion'
         formattingTemplate = '''Subject: Notification for $[/myPipeline/pipelineName]
 
 Message for $[/myPipeline/pipelineName]'''
       }
     }
   }
 
   pipeline 'demo_pipeline', {
     enabled = '1'
 
     stage 'qe', {
       pipelineName = 'demo_pipeline'
 
       task 'dev-t1', {
         enabled = '1'
         errorHandling = 'stopOnError'
         subproject = 'Default'
         subworkflowDefinition = 'wf'
         subworkflowStartingState = 'st1'
         taskType = 'WORKFLOW'
       }
     }
   }
 
 }
 



avatar image By nitinp 539 answered Jul 05, 2017 at 10:57 PM
more ▼
(comments are locked)
10|750 characters needed characters left
Your answer
toggle preview:

Up to 8 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.