issueUrl coming back blank for both Jira and DevOps when exalate triggered from Jira side

Hello,

Im exalating from Jira side using a trigger there so it created a DevOps ticket.

I can see issueUrl being populated when i check local and remote replicas, however, if i try to populate issueUrl in any field in both Jira or DevOps, it comes out as blank with no information.

Im trying to do this to be able to populate the links for each side into the other one, I had as a workaround been able to hardcode the links and add the “Key” since this is coming up.

Any ideas why this is happening?

Thanks

Indeed, this should not be happening.

Can you share the line you are using in Incoming script that is attempting to populate this, and also where are you trying to populate this - I assume it is a custom field. What type is the field?

Thanks

Hi @Lautaro

So your use case is trigger the issue from Jira to Azure DevOps then here are the sample scripts:

Jira Outgoing script:

replica.key = issue.key

The ADO incoming script will be:

if (firstSync) {
// other stuff like project key ., issue type
syncHelper.syncBackAfterProcessing()
/*
in case you want to put the remote url in system field like description for example:
workItem.description = issueUrl
/
}
workItem.summary = replica.summary
…
/

//in case you want to store in custom field then following script will be used , the reason is custom fields are not loaded in first sync so we need to use store function.
if(firstSync){
store()
workItem.customFields.“Remote ID”.value=issueUrl
}
*/

Jira Incoming side:

if(!firstSync && syncRequest.remoteSyncEventNumber==1){
issue.customFields.“Local custom field name”.value =issueUrl
}

If the flow is from ADO to Jira then the script will be changed accordingly

Thanks,
Sonal

Hello, Ive tried everything from pasting it in a custom field called Remote URL to just trying on the description.

I’ve tried pulling it from Jira and from DevOps to no avail.

Jira Outgoing I have
replica.issueUrl = issue.url

DevOps Outgoing I have
replica.issueUrl = workItem.url

On both incomings I’ve tried to pull it into a custom field, even to the description to see what was coming out of it, its nothing, just blank for the issueUrl .

If i check local and remote replicas i can see the line showing the issueUrl there.

Im a bit lost

These do not look correct.

Did you try the suggestion made by Sonal above please as that looks accurate to me i.e. workItem.customFields.“Remote ID”.value=issueUrl

@Lautaro

Can you pease share incoming and outgoing sync script of both the systems , we can help you to modify the existing script?

Thanks,
Sonal

Hello, please see code below:

Outgoing Jira

// Outgoing script (Jira → Azure DevOps)

// let DevOps know which JIRA key this came from
replica.key = issue.key

// basic fields
replica.summary = issue.summary
//This line below, transforms description from Markdown to HTML to transfer over
replica.description = nodeHelper.getHtmlField(issue, “description”)

replica.attachments = issue.attachments

// custom-field mappings (make sure the names match exactly what you use in Azure incoming)
replica.customFields.“DevOpsProject” = issue.customFields.“DevOps Project”
replica.customFields.“CustomerRequestType” = issue.customFields.“Customer Request Type”

// send back a link so Azure can stamp it on the work item
replica.issueUrl = issue.url
// explicitly request Azure DevOps to run outgoing script and reply
syncHelper.syncBackAfterProcessing()

Incoming Jira

if (firstSync) {
issue.projectKey = “ITS”
issue.typeName = “CI”
syncHelper.syncBackAfterProcessing()
}

def org = “lawsociety”
def projectNameRaw = issue.customFields.“DevOps Project”?.value?.value ?: “UNKNOWN_PROJECT”
def projectNameUrl = projectNameRaw.replaceAll(’ ', ‘%20’)
def devopsUrl = “https://dev.azure.com/${org}/${projectNameUrl}/_workitems/edit/${replica.key ?: ‘UNKNOWN_ID’}”
issue.customFields.“Remote URL”.value = devopsUrl

Outgoing DevOps

// Outgoing script (Azure DevOps → Jira)

replica.key = workItem.key
replica.summary = workItem.summary
replica.issueUrl = workItem.url

Incoming DevOps

// CODE
if (firstSync) {
workItem.projectKey = replica.customFields.“DevOpsProject”?.value?.value ?: “DEFAULT_PROJECT”
workItem.typeName = “User Story”
workItem.summary = replica.summary
//workItem.description = replica.description
// Prepend JIRA info to description
def jiraUrl = “https://lawsociety.atlassian.net/browse/${replica.key}”
def jiraInfo = “JIRA TICKET → ${jiraUrl}” // 4 newlines after the link
//def plainDescription = nodeHelper.stripHtml(replica.description ?: “”)
workItem.description = jiraInfo + “\n\n\n” + replica.description
syncHelper.syncBackAfterProcessing()
}
//replicate the link after the first sync
if (workItem.customFields[“Custom.JIRA”] != null) {
workItem.customFields[“Custom.JIRA”].value = jiraInfo
store(workItem)
}

Local replica shows issueUrl (look below)

“eventTriggerContext”: {},
“description”: “

New test version

\n

SHOULD LOOOK NICE AND PRETY

\n

<span class="image-wrap" style=""><img src="/attachments/596504?name=image-20250715-060636.png" alt="image-20250715-060636.png">

\n

This bug is reported in the SIT AND UAT testing.

\n<div class="panel" style="background-color: #deebff;border-width: 1px;">\n <div class="panelContent" style="background-color: #deebff;">\n

Suggested Change

\n \n\n

To investigate and resolve the bug that is causing the duplication and error message.

\n<div class="panel" style="background-color: #eae6ff;border-width: 1px;">\n <div class="panelContent" style="background-color: #eae6ff;">\n

Reason for Change

\n \n\n

The bug will cause confusion to the users as duplicating folders is not an expected result from renaming files.

\n<div class="panel" style="background-color: #e3fcef;border-width: 1px;">\n <div class="panelContent" style="background-color: #e3fcef;">\n

Acceptance Criteria

\n \n\n

Renaming files will not cause an error, nor should duplication happen afterwards.

”,
“watchers”: ,
“key”: “ITS-273689”,
“summary”: “test Testing - Jira DevOps v11”,
“comments”: ,
“workLogs”: ,
“affectedVersions”:
},
“issueUrl”: “https://xxxxxx.atlassian.net/browse/xxxxxxxx”


and remote replica shows it too

"summary": "test Testing - Jira DevOps v11",
"comments": [],
"workLogs": [],
"affectedVersions": []

},
“issueUrl”: “Azure DevOps Services | Sign In”
}

Hello Majid, Thanks for your input. The ones i shared are for the Outgoing, Sonal suggested for the Incoming side. I did try anyways, but since issueUrl is empty, the script errors out

I will update you on Monday, I need to check your scripts may be i will provide you the modified scripts