Syndeia 3.2 (Plugin for MagicDraw)
Tutorial Exercise 8.7
Creating SysML – JIRA Mappings
| 47 Perimeter Ctr E, Suite 410 |
...
Objectives
Anchor | ||||
---|---|---|---|---|
|
Preparation
Anchor | ||||
---|---|---|---|---|
|
Close MagicDraw, if it is open
anchor_Ref535430607 _Ref535430607 Rename the existing syndeia.mappings file in the .syndeia folder to something like syndeiaOld.mappings
Copy syndeiaTutorial.mappings into the .syndeia folder
Rename syndeiaTutorial.mappings as syndeia.mappings
When you have completed the mapping tutorial exercises, you may want to reverse this process to restore the original mappings file.
Any Syndeia user can use or view the mapping specifications, but Syndeia requires a special license in addition to the regular Syndeia license in order to create, modify or delete mapping information. It is good practice to confine this duty to a very limited number of experienced users or system administrators, who will provide mappings for the general users.
Exercise
Open or create a SysML project with Syndeia_Profile.mdzip added as a module, then right-click the main package in the model and launch the Syndeia dashboard.
Select or add the JIRA repository you intend to use for this exercise in the Repository Manager tab to ensure that your credentials are entered correctly before beginning.
Figure 1 Syndeia dashboard, Repository Manager tab, showing JIRA repository loaded correctlyGo to the Mappings tab.
You should see Model Types and Mapping Groups listed on the LHS as shown in Figure 2. If you don't, go back and perform the steps under Preparation.Anchor _Hlk501357103 _Hlk501357103
...
...
The first task will be to make a new JIRA artifact type available for mapping.
Select JIRA under Model Types in the left column. Initially, the window should appear similar to Figure 3, with three existing JIRA artifact types available
.
...
...
...
.
...
Specify the JIRA artifact type attributes to be available for mapping
If you click the Get Issue Properties button at this point without an entry in the Key of sample issue field first, Syndeia will return all properties for the given Issue Type in the given Project that can be set by the user when an issue is created.
For the issue type we have selected, the attributes are populated as shown in Figure 5. The properties that can be set at creation here include fields such as Assignee, Description, and Due Date, but do not include other properties that are set automatically by the system such as key and created date, or can be changed later, such as status and resolution.
If you see all the properties you wish to map at this point, you can select them with the checkboxes or the Select All button (you can choose which ones to map later) and click OK to create your artifact type and move to step 6.
If you do not see all the attributes you would like to map yet, then continue to step 5c to use a sample issue key to return the rest of your attributes.
Anchor _Ref5018117 _Ref5018117 Figure 5 Add JIRA Artifact Type window, lower half: all properties set by user upon issue creationAnchor _Ref5019640 _Ref5019640 If some attributes you would like to map are missing, find an existing JIRA issue of the desired issue type or create a new one that has all the attributes populated that you wish to map. Figure 6 shows a sample Improvement issue I have created, making sure to populate the Resolution field in order to expose that field for mapping. Some fields such as key and created date have been populated automatically by JIRA.
Anchor _Ref5019297 _Ref5019297 Figure 6 Sample JIRA Improvement issue with all desired fields populated
Enter the key of your sample issue (in my case SDB-1671) into the field labeled "Key of sample issue" and click. The table will be populated as shown in Figure 7, including all attributes that had been populated for the sample issue.
You can select all the properties at this stage by clicking Select All and later choose the ones you want to map. Click OK.
...
...
From here you have two options,
anchorOption 1 – If you are mapping JIRA issues to a SysML block, you can map JIRA issue properties to value properties of the SysML block (Option 1). If you want to map JIRA issue properties to tags of stereotypes applied to the SysML block, use Option 2 below.
Proceed to steps 7-8 if you are using Option 1
Option 2 – You can use this option if:
You are mapping JIRA issues to SysML elements that are not blocks (e.g. requirement, activity, etc.) and want to map JIRA issue properties to tags of stereotypes applied to those SysML elements. OR
You are mapping JIRA issues to SysML blocks but want to map JIRA issue properties to tags of stereotypes applied to those SysML blocks, and not value properties.
Proceed to steps 9-10 if you are using Option 2.
...
_Ref5028921 _Ref5028921 Option 1 - If you plan to map JIRA issue properties to SysML block value properties, you will need to add a SysML artifact of Block type and then add the appropriate value properties.
Anchor _Ref5028924 _Ref5028924 Under Model Types in the left column, right-click SysML and select Add Artifact Type.
In the Add Artifact Type window that appears, set Type to Block and set Name, Block (JIRA Properties) in this example, and Description as desired. Click OK.
Expand SysML under Model Types, right-click the artifact type that you just created, e.g. Block (JIRA Properties), and select Add/Edit Attribute Definition.
The name and documentation fields of the SysML element are already entered under Attribute Definitions. Use the + button to add an additional line for each value property you would like available to map to JIRA properties.
Fill out Display Name, Internal Name, and Description (they can all be the same thing) that you want the value properties to have in the SysML artifact.
For Meta Type column, use ValueProperty as shown for all attributes.
Anchor _Ref5029190 _Ref5029190 You can uncheck isRequired column, then click OK
...
...
...
The next task is to create a new mapping using the new JIRA and SysML model element types.
Right-click SysML - JIRA under Mapping Groups in the left column and select Add Mapping
Set a name and description reflecting the SysML and JIRA artifact type you are using along with any other information about the mapping you wish to preserve.
Set Source Artifact Type to your SysML artifact type, Block (JIRA Properties) in our example, using pull-down menu,
Set Target Artifact Type to your JIRA artifact type, Improvement in our example, using pull-down menu
Set Structure Level to NO_CHILDREN, using pull-down menu.
Set Include Attributes to Include Attributes, using pull-down menu.
_Ref535405772 Anchor _Ref535405768 _Ref535405768 Figure 9 Syndeia dashboard, Mappings tab, adding a mapping in the SysML-JIRA Mapping GroupAnchor _Ref535405772 To map the attributes between Block (JIRA Properties) and Improvement, follow this process.
Click Retrieve Available Attribute Definitions
Click the + button to create rows for the attributes you wish to map, selecting the value properties you created for the SysML block type Block (JIRA Properties) on the left hand side (Source) and the JIRA properties from Improvement on the right hand side (Target)
Click Save Mapping at the bottom. The new mapping should appear in the list under the SysML – JIRA mapping group in the left column and should be available in the Select Mapping Specification window when creating a Data Map or Model Transform connection.
Option 2 - If using stereotype tags instead of block value properties for the mapping, you will not need to create a new SysML artifact type, but you will need to create or modify a SysML stereotype with tags corresponding to the values you wish to map.
The Syndeia mapping tutorials come with a special profile, SyndeiaTutorialMapping.mdzip – Either open this file to modify the stereotypes and tags, or provide your own stereotypes. Here, we will discuss how to modify and use the stereotypes that comes with SyndeiaTutorialMapping profile.
Note: Do not modify or use the Syndeia_Profile.mdzip profile for mappings.
Open the SyndeiaTutorialMapping.mdzip file in MagicDraw. Once you have opened the profile you should expand <<JIRA_Issue>> to view the tag values. All properties except -base_class will be available as tags for mapping.
...
Here you see we have created status, priority, reporter, assignee, components, summary, issuetype, description and resolution. Add a new property to this stereotype (or to your own stereotype) for each custom value you wish to map to a stereotype tag value, and type it with a value type such as String
Save the profile once you have added the tag values you will need and add the profile as a module to your SysML project, or reload it if you had already added it before making the above modifications.
...
Make sure the changes are reflected in the tree
...
Anchor _Ref5028578 _Ref5028578 Next, we create another new mapping using the new JIRA model element type and SysML stereotype.
Right-click SysML - JIRA under Mapping Groups in the left column and select Add Mapping
Set a name and description reflecting the SysML and JIRA artifact type you are using along with any other information about the mapping you wish to preserve.
Set Source Artifact Type to the desired SysML artifact type (e.g. Block), using pull-down menu
Set Target Artifact Type to your JIRA artifact type (Improvement in our example), using pull-down menu
Set Structure Level to NO_CHILDREN, using pull-down menu
Set Include Attributes to Include Attributes, using pull-down menu
Go down to the Stereotypes section and click the + sign and navigate to the stereotype modified in step 9
Map stereotype values to JIRA attribute values as shown below
Under Attribute Definition Mappings, click Retrieve Available Attribute Definitions
Click the + button to create rows for the attributes you wish to map
Select the tag values you created for the SysML stereotype on the left hand side (Source) and the JIRA properties from the JIRA artifact type you created on the right hand side (Target)
Figure 10 Syndeia dashboard, Mappings tab, adding a mapping in the SysML-JIRA Mapping Group
Click Save Mapping at the bottom. The new mapping should appear in the list under the SysML – JIRA mapping group in the left column and should be available in the Select Mapping Specification window when creating a Data Map or Model Transform connection.
Go to the Settings tab (Figure 11) and check Use mapping under the General heading, if not already checked. Click Apply.
Anchor _Ref481833169 _Ref481833169 Figure 11 Syndeia dashboard, Settings tab, Use mapping checkedAnchor _Hlk508023476 _Hlk508023476Create a block in SysML if not already created and then refresh the package on the LHS, then drag the block to JIRA to create a JIRA issue.
Go to the Connection Manager tab. In the right column, select the JIRA repository connection and expand Projects to show the project in which you want to create a new JIRA issue (The project is Intercax Help Desk in our examples).
anchor_Ref501711471 _Ref501711471 Figure 12 Syndeia dashboard, Connection Manager tab, drag Improvement A block into Intercax Help Desk project and select Block-Improvement mappingChoose Data Map or Model Transform in the central column.
Drag-and-drop block on the left onto the JIRA project on the right.
A small pull-down menu will appear on the Syndeia dashboard, as in Figure 12, showing the possible mappings available for a block dragged into JIRA.
Select the mapping you created and click OK.
Expand the project, Issues, and Reported by me folder (Figure 13). A new JIRA issue (IHD-443 in this example) has been created with default attribute values assigned by JIRA.
...
...
If the mapping in step 10 uses a special SysML stereotype, Syndeia will automatically apply that stereotype to the SysML elements from which the JIRA element was created. If you wish to set the SysML tag values before generating the JIRA issue, apply the stereotype first and populate the tag values.
You may also drag and drop a JIRA issue of the same type to SysML and it will create the block with the specified value properties.
...
...
Figure 14 Connection Manager after new JIRA issue is created
...
You should be able to compare and sync these values using the mapping applied when the connection was created.
Options 1 and 2 in this exercise can be combined, i.e. a SysML element of type Block can have both tag values and value properties that map to attributes of the JIRA element. After the new SysML artifact is created (step 7), but before the mapping is created (step 8), select the new SysML element, Block (JIRA Properties) in our example, under Model Types, SysML in the left column, and add a stereotype with the desired tag values. After clicking Refresh, the tag values should appear in the Attribute Definitions table below and will be available for assignment during mapping.
...