JIRA
6 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 Sync Area and Iteration Paths Between Jira and Azure DevOps
Azure DevOps area and iteration paths do not have a direct replica on the Jira side. So to sync information between both systems, the area and iteration path data has to be mapped to a custom field in the Jira issue. For this to work, you need a customizable AI-powered integration solution like Exalate. This solution will help you generate the script for mapping paths and maintaining the relationships between the work item and the issue. What is an Area Path? An area path establishes a hierarchy for work items related to a specific project. It helps you group work items based on team, product, or feature. Organizations working on a product or feature can use area paths to establish a hierarchy between teams at every level of involvement. You can assign the same area path to multiple teams. What is an Iteration Path? An iteration path assigns work items at the project level based on time-related intervals. Teams can share them to keep track of ongoing projects, specifically for sprints, releases, and subreleases. When new work items are added to the Sprint backlog, they become accessible via the existing iteration path. You can add up to 300 iteration paths per team. Sync Area and Iteration Paths: Jira to Azure DevOps Use Case You can create a custom field in your Jira instance to reflect the data from the iteration and area paths. How does this help your organization? Syncing this data gives more context about the teams involved on the Azure DevOps side. It provides context about the timelines and stages of progress for the mapped projects and entities. Primary Requirements Obtaining the right information from the API on both sides. Writing or generating the correct sync rules for both the incoming and outgoing data. Creating triggers to update the custom fields on Jira automatically. Fetching the right string from the area or iteration path. How Exalate Handles Jira to Azure DevOps Syncs Exalate supports one-way and two-way integration between Jira and Azure DevOps as well as with Zendesk, ServiceNow, Salesforce, GitHub, etc. Exalate also supports AI-powered Groovy scripting with the help of a chatbot. Users can also create trigger-based integrations for real-time syncs and bulk operations. To use Exalate, first install it on both Jira and Azure DevOps. Since this use case requires scripting, you need to set up a connection in the Script Mode. To configure the sync, open Exalate in your Azure DevOps dashboard, go to the connection you want to edit and click on the “Edit connection” icon. You have two options: Outgoing sync (on the Azure DevOps side) refers to the data being sent over to Jira. Incoming sync (on the Jira side) refers to the data to be received from the work item on Azure DevOps. Outgoing Sync (Azure DevOps): Send Area and Iteration Path Details from Azure DevOps to Jira To send out the area and iteration paths from the Azure DevOps work item, use the code below: replica.areaPath = workItem.areaPath replica.iterationPath = workItem.iterationPath The replica retrieves the values of the area and iteration paths from the work item and saves them as a string. On the remote side, you can store the area/iteration path in a custom field using a type string or select list. Incoming Sync (Jira): Set Area Path from Azure DevOps as a Custom Field in Jira Let’s start with the area path. The area path starts with the name of the project. For example, an Azure DevOps project called AzureProject handled by Exalate’s dev team could have an area path: AzureProject\\ExalateDev. To set the area path based on the value received from the remote side text field, use the code below: issue.customFields."Area Path".value = replica.areaPath The issue.customFields."area-path".value retrieves data from the work item and stores it in the designated custom field on Jira. Incoming Sync (Jira) Set Iteration Path from Azure DevOps as a Custom Field in Jira The iteration path shows the name of the project as well as the specific sprint. For example, an Azure DevOps project called AzureProject in the first sprint could have an area path: AzureProject//Sprint1 If you don’t set the value for the Area field in the Sync Rules, Exalate uses the default area that has the same name as the project. To set the iteration path based on the value received from the remote side text field, use the code below: issue.customFields."iPath".value = replica.iterationPath The issue.customFields."iPath".value retrieves data from the work item and stores it in the designated custom field on Jira. Congratulations! You have successfully mapped the area and iteration path to a Jira custom field. If you still have questions or want to see how Exalate is tailored to your specific use case, drop a comment below or reach out to our engineers.66Views0likes0CommentsHow to sync Text, Date, and Dropdown Custom fields between Jira and Azure DevOps
Jira Azure DevOps integration is the need of the day. Both platforms offer robust features but when it comes to integrating data like custom fields, things can get tricky. This is where tools like third-party integration tools can help, ensuring your custom data flows effortlessly between Jira and Azure DevOps. In this blog, we'll dive into a common use case: syncing custom fields between Jira and Azure DevOps. We'll explore the key custom fields—Text, Dropdown, and Date—and provide code snippets to illustrate how third-party apps can make this process straightforward. Why sync custom fields? Custom fields allow teams to capture unique data that goes beyond standard fields like summary or status. By syncing custom fields, you ensure that all teams, regardless of the platform they use, have access to the same critical information. This leads to better collaboration, reduced errors, and a unified workflow. Setting up the environment for syncing custom fields between Jira and Azure DevOps We will use a tool called Exalate for this article. Start by installing Exalate on Jira and Azure DevOps from their respective marketplaces and connect them using the Script mode. The Script mode has incoming and outgoing sync rules written using low-code Groovy scripts. You can edit them at both integrating ends to meet your sync requirements. To send custom field data from a Jira issue field to its corresponding Azure DevOps work item field you’d need to modify the outgoing sync rules of your Jira instance. You would also need to receive the data coming from Jira in some work item field. For this, you’d need to modify the incoming sync rules of your Azure DevOps instance. To do this the other way around, simply reverse the codes in the incoming and outgoing sync scripts. That's all! Set an automatic trigger as the next step and see your data synced smoothly between the systems. Custom fields sync: a deeper look 1. Jira to Azure DevOps text field sync Text fields are commonly used to capture detailed information. Whether it's a technical description or customer feedback, syncing text fields ensures that all teams have a consistent narrative. //Jira outgoing sync replica.customFields."CF Name" = issue.customFields."CF Name" //Azure DevOps incoming sync workItem.customFields."CF Name".value = replica.customFields."CF Name".value Here, we simply map the text field from Jira to Azure DevOps and vice versa. Exalate takes care of the data transformation and transmission. 2. Jira to Azure DevOps Dropdown (select List) field sync Dropdown or select list fields are perfect for categorizing information, like selecting a priority level or feature type. Syncing these ensures that the categorizations are consistent across platforms. //Jira outgoing sync replica.customFields."CF Name" = issue.customFields."CF Name" //Azure DevOps incoming sync workItem.customFields."CF Name".value = replica.customFields."CF Name".value.value The code snippet captures the dropdown object with its values in one platform and assigns it to the corresponding field in the other. 3. Jira to Azure DevOps Date field sync Date fields are essential for tracking deadlines, milestones, and other time-sensitive data. Keeping dates in sync prevents miscommunications and scheduling conflicts. //Jira outgoing sync replica.customFields."CF Name" = issue.customFields."CF Name" //Azure DevOps incoming sync import java.text.SimpleDateFormat .... def sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss") def targetDate = sdf.format(new Date()) //throw new Exception("Target date = ${targetDate}") workItem."Microsoft.VSTS.Scheduling.StartDate" = targetDate This snippet ensures that the date values are synchronized, keeping project timelines aligned. Best practices for syncing custom fields between Jira and Azure DevOps Consistent field types: Ensure that the custom fields in Jira and Azure DevOps have compatible types. Field mapping: Carefully map the fields to avoid data loss or misinterpretation. Testing: Always test the sync setup in a sandbox environment before deploying it in production. Conclusion Synchronizing custom fields between Jira and Azure DevOps can enhance your project's efficiency and transparency. It ensures all teams have access to the same data, regardless of the platforms they use. Ready to sync more data between Jira and Azure DevOps? Drop a comment and we can discuss.77Views0likes0CommentsMigrating content/boards in JIRA Kanban boards to Azure DevOps Boards
How to migrate all the Kanban boards in JIRA instance of a project to Azure DevOps boards. the problem is there are hundreds of boards in JIRA and manually doing the task takes long hours, is there a way to automate the process.465Views0likes0CommentsCreating new jira cloud connector Create URL Something went wrong
Hi, I'm trying to add a Jira cloud connector on my sharepoint site, but after entering a name I just get this message: Something went wrong. An unexpected error occurred. Please try again. RequestId: c3e8c01a-f3f5-2a9f-3fde-1007ad226b5c Server: AM6PR10MB2855 Date: 12/13/2023 4:49:33 PM Any help would be great955Views0likes3Comments