Azure DevOps
1386 TopicsHow to sync date and time formats between Azure DevOps and Jira?
Jira Cloud and Azure DevOps have different APIs that support different data formats, even for the same type of data. Azure DevOps uses the HTML format, while Jira uses Wiki. When transferring date-time information between both platforms, transformers need to work behind the scenes to convert between both formatting styles. That’s the only way to get coherent data. But, this conversion is not available by default due to the lack of compatibility. So, a third-party tool is needed to bridge this gap. In this article, I’ll discuss how to sync date and time formats between Azure DevOps and Jira Cloud. We'll use a third-party integration tool called Exalate to implement this use case. Use case requirements If your Jira and Azure DevOps instances are hosted in different time zones, and you need to manipulate the date-time fields so that the same date is kept, here is how we do it. Let us assume the two teams are 5 hours apart. Here is what we can do: “Due Date” and “Start Date” are custom date-time fields in Azure DevOps “Start date” is a custom date field in Jira “Due” is the standard due date field in Jira We would like to add 5 hours to the Jira timestamp when they are received in the Azure DevOps instance. Then, we would like to subtract 5 hours from the Azure DevOps timestamp when they are received in Jira. How to use Exalate to sync date and time formats between Azure DevOps and Jira cloud? Exalate comes with an AI-powered scripting engine that allows you to write mapping rules for any connection. It supports the Groovy language, which you can use to write the transformation algorithm for the date-time information. To implement this use case, you need to install Exalate on both your Jira Cloud and Azure DevOps instance. Then, set up a connection in the Script mode. Once connected, click Configure Sync and navigate to the Rules tab, where you’ll set up sync rules. In the Rules tab, you’ll find default scripts for syncing basic fields like summary, description, comments, and attachments. To sync custom fields or behaviors, you’ll need to add your own scripts. The Rules tab is divided into: Outgoing Sync: Defines the information sent from Jira to Azure DevOps. Incoming Sync: Maps the information received from Azure DevOps into Jira. The same exists on the Azure DevOps side. Jira outgoing script replica.customFields."Start date" = issue.customFields."Start date" replica.due = issue.due The script for the data going out of Jira is being fetched from the custom field named “Start date”, while the due date is going over as the replica.due expression. Jira incoming script import java.text.SimpleDateFormat import java.text.DateFormat import java.util.Calendar import java.util.Date def datePattern = "yyyy-MM-dd HH:mm:ss"; DateFormat formatter = new SimpleDateFormat(datePattern); dateString = replica."start" dateString = dateString.replaceAll("T"," ").trim(); dateString = dateString.replaceAll("Z"," ").trim(); date = formatter.parse(dateString); def timestamp = date.time Calendar calendar = Calendar.getInstance() calendar.timeInMillis = timestamp calendar.add(Calendar.HOUR_OF_DAY, -5) def updatedTimestamp = calendar.timeInMillis issue.customFields."Start date".value = updatedTimestamp dateString = replica."duedate" dateString = dateString.replaceAll("T"," ").trim(); dateString = dateString.replaceAll("Z"," ").trim(); date = formatter.parse(dateString); timestamp = date.time calendar.timeInMillis = timestamp calendar.add(Calendar.HOUR_OF_DAY, -5) issue.due = calendar.getTime() The code snippet above allows you to set the datePattern and parsing it through a formatter. It also fetches the timestamp down to milliseconds from the calendar. The calendar.add(Calendar.HOUR_OF_DAY, -5) expression specifies that the timestamp coming into Jira should be at least 5 hours behind the original time obtained from Azure DevOps. Azure DevOps outgoing script replica."start" = workItem."Microsoft.VSTS.Scheduling.StartDate" replica."duedate" = workItem."Microsoft.VSTS.Scheduling.DueDate" This code snippet fetches the start and due dates from the default Microsoft Azure DevOps Server (formerly VSTS or Visual Studio Team System). Azure DevOps incoming script import java.text.SimpleDateFormat import java.util.Calendar import java.util.Date def convertJiraTimeToAdoTime(String dateString){ if(dateString == null) return String inputFormat = "yyyy-MM-dd HH:mm:ss.S" String outputFormat = "yyyy-MM-dd'T'HH:mm:ss'Z'" // Create SimpleDateFormat objects for the input and output formats SimpleDateFormat inputDateFormat = new SimpleDateFormat(inputFormat) SimpleDateFormat outputDateFormat = new SimpleDateFormat(outputFormat) // Parse the input date string into a Date object Date date = inputDateFormat.parse(dateString) def timestamp = date.time Calendar calendar = Calendar.getInstance() calendar.timeInMillis = timestamp calendar.add(Calendar.HOUR_OF_DAY, 5) def updatedTimestamp = calendar.timeInMillis // Convert the Date object into the output format return outputDateFormat.format(updatedTimestamp) // String } // does not set the field String inputDateString = replica.customFields."Start date"?.value workItem."Microsoft.VSTS.Scheduling.StartDate" = convertJiraTimeToAdoTime(inputDateString) inputDateString = replica.due workItem."Microsoft.VSTS.Scheduling.DueDate" = convertJiraTimeToAdoTime(inputDateString) This code snippet converts the incoming date-time information into a string before parsing it as input into the date object. It then fetches the date from the calendar to be 5 hours ahead of the time fetched from the Jira Cloud instance. Once you’re done, review the scripts to make sure everything is in order before publishing the changes. That’s all! Your date-time formats are now in sync between Azure DevOps and Jira Cloud. Using script-based solutions, like Exalate, can seem overwhelming at first, but if done correctly, they can be very effective for your integration needs. Have any specific use case that requires handling different data formats? Just ask our integration engineers for a walkthrough of what’s possible or drop a comment here.7Views0likes0CommentsHow to reduce downloading time for releasing pipeline
When I do a deployment task on a given deployment server, it downloads all linked artifacts for the entire release. So I'm downloading a ton of stuff I don't need. For Example, if it taking 10 minutes to complete the task and out of 10 minutes, it takes 8 minutes just to download artifacts. Is there a way to avoid downloading unnecessary artifacts?415Views0likes1CommentData Migration from azure devops serveer to new one
I have a problem in data migration from Azure DevOps server to the new one in my case, i have a split database on a different machine. So, I have two environments: each one contains a devops server and database in splitter machines i want to migrate the whole data from different tools to a new one and the problem is as the organization roles i do not have all administration privileges on databases and devops machines So, I want a determined way to get the whole data from the old one to the new one (especially privileges that are required to ask the admin to give me ) with clear steps335Views0likes1CommentPost-job: Cache fails
In the pic above Iam trying to cache my yaml.lock file to reduce runtime and Iam using the azure devops docs to do that. The first Cache step seems to work fine and there is "a cache miss" and then it runs yarn install. But the Error comes in the Post-job: Its taking 10 minutes and then timing out i think. --Note-- Iam using a self hosted agent here and i added GNU Tar and 7-zip and restarted the agent. --End Note-- I dont know if the above had something to do with my problem. But it didnt work before or after. Can anyone help out here?641Views0likes1CommentError Unauthorized when trigger a flow with Webhook and HTTP request
Hi guys, I have an error when O want to send a webhook from Azure DevOps to trigger a Flow with an HTTP request. In Azure DevOps I get an Unauthorized error. But when I access the HTTP request URL in the browser everything works fine. Can anybody help? Thx!!438Views0likes1CommentVelocity Chart Not Showing Planned Work (Blue Bar) for Specific Sprints
I researched a lot and discussed with my friends as well on this issue but could not get any help. The Velocity Chart widget is not showing planned work (Blue Bar) for first 3 sprints. Earlier it was showing but suddenly it stopped showing. I am unable to find the reason. However from sprint 4 (current sprint) it is showing the planned work. Any help would be appreciated. Here is the snapshot of Velocity Chart configuration625Views0likes3CommentsAzure DevOps pipeline Jira integration
We are facing an issue on Azure DevOps pipeline integration with jira cloud. When we enable the "Report deployment status to jira" checkbox by choosing the jira service connection and after clicking on the save button, it is getting disabled by itself. There is no error popping up to troubleshoot this issue further. We have service connection in Azure DevOps through Azure pipelines forjira app.2.5KViews0likes4CommentsDevice In Azure AD showing as not compliant, yet in Intune the device is fine and compliant
Hello All I have several devices that are now failing SSO logins because of Conditional Access retuning as the device is not Compliant, Checking the device in Azure AD (Entra) is clearly shows the device is not compliant, which explains why the SSO logins are blocked. But when I check the device in Intune (Endpoint) it shows the device is compliant and all good (you will have to take my word the 2 screen shots are the same device as the host name is blurred) When checking the device ID in Azure AD and Intune they all match as you would expect. The Devices are checking in and Syncing with Azure and Intune on a regular basis. Azure is just not updating with the correct Compliance status from Intune. Any Ideas what is happening Cheers Colin26KViews0likes8Comments