This article provides the code snippet to create a new issue in a different Jira Cloud instance using callRest filter and Atlassian Jira REST API

(blue star) Instructions

  1. Navigate to the intended workflow to make the necessary changes in the edit mode.

  2. Select the required transition.

  3. Select the Post functions tab and click Add post function.

  4. Add the Build-your-own (scripted) Post-function post-function with the below template:

    {{ "https://<URL>/rest/api/3/issue" | callRest(verb=("post"),
                   body= {
                        "fields": {
                       		"project": {
                            	"key":"JSM"
                                },
                            "summary": "From JMWE post-function",
                             "issuetype": {
                                      "id": "10006"
                                      },
                                      "customfield_10064": "val 1"
    					}
                   },
                   options= {
    					headers: {
    						"authorization": "Basic XXXXXXXXXX"
    					}
    				}) | dump(2) }} 

Replace:

References

(blue star) Related articles