我如何使用声明性语法配置 Jenkins 多分支流水线创建的作业?

How i can configure jobs created by Jenkins multi-branch Pipeline using declarative syntax?

例如,我想配置 Notification plugin 以使用声明性语法在多分支流水线中使用。 为此,snippet generator 为我提供了如下代码:

properties([  
   [  
      $class:'HudsonNotificationProperty',
      endpoints:[  
         [  
            urlInfo:[  
               urlOrId:'https://example.com/smth',
               urlType:'PUBLIC'
            ]
         ]
      ]
   ],
   pipelineTriggers(   [  

   ]   )
])

我相信它是用 Scripted Pipeline syntax. How can I integrate this into my project using Declarative Pipeline 语法写的?

在声明管道之前粘贴您的属性片段:

#!/usr/bin/env groovy

properties([[$class: 'HudsonNotificationProperty',
  endpoints: [[urlInfo: [urlOrId: 'https://foo.bar.com', urlType: 'PUBLIC']]]]]
 )

pipeline {
...
}